Re: [GSoC][PATCH v3 7/9] builtin/refs: add optimize subcommand
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 18, 2025, 16:06 UTC
- Message-ID
- <xmqqecs3923j.fsf@gitster.g>
- In-Reply-To
- <20250918054704.544254-8-meetsoni3017@gmail.com>
Meet Soni <meetsoni3017@gmail.com> writes:
Show 17 quoted lines
> diff --git a/builtin/refs.c b/builtin/refs.c
> index 76224feba4..ae395759bd 100644
> --- a/builtin/refs.c
> +++ b/builtin/refs.c
> ...
> +#define REFS_OPTIMIZE_USAGE \
> + N_("git refs optimize " PACK_REFS_OPTS)
> +
> static int cmd_refs_migrate(int argc, const char **argv, const char *prefix,
> struct repository *repo UNUSED)
> {
> @@ -113,6 +117,17 @@ static int cmd_refs_list(int argc, const char **argv, const char *prefix,
> return for_each_ref_core(argc, argv, prefix, repo, refs_list_usage);
> }
>
> +static int cmd_refs_optimize(int argc, const char **argv, const char *prefix,
> + struct repository *repo)This line does not align; will locally fix (no need to resend only to fix this).
Show 19 quoted lines
> +{
> + static char const * const refs_optimize_usage[] = {
> + REFS_OPTIMIZE_USAGE,
> + NULL
> + };
> +
> + return pack_refs_core(argc, argv, prefix, repo, refs_optimize_usage);
> +}
> +
> int cmd_refs(int argc,
> const char **argv,
> const char *prefix,
> @@ -122,6 +137,7 @@ int cmd_refs(int argc,
> REFS_MIGRATE_USAGE,
> REFS_VERIFY_USAGE,
> "git refs list " COMMON_USAGE_FOR_EACH_REF,
> + REFS_OPTIMIZE_USAGE,
> NULL,
> };We may want to clean this up outside this topic, perhaps a clean-up patch after all the dust settles. Lack of REFS_LIST_USAGE stands out like a sore thumb.