Subject: Re: [GSoC][PATCH v3 7/9] builtin/refs: add optimize subcommand

From: Junio C Hamano <[email-masked]>
Date: Thu, 18 Sep 2025 09:06:56 -0700

Meet Soni <[email-masked]> writes:

> 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).

> +{
> +	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.