Re: [PATCH 1/5] commit-graph: define common usage with a macro
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Feb 16, 2021, 11:33 UTC
- Message-ID
- <8ac1dcc5-c21c-4c93-b762-1cc0a27bbeae@gmail.com>
- In-Reply-To
- <20210215184118.11306-2-avarab@gmail.com>
On 2/15/2021 1:41 PM, Ævar Arnfjörð Bjarmason wrote:
Show 16 quoted lines
> +static const char * builtin_commit_graph_verify_usage[] = {
> +#define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
> + N_("git commit-graph verify [--object-dir <objdir>] [--shallow] [--[no-]progress]")
> + BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
> NULL
> };
>
> +static const char * builtin_commit_graph_write_usage[] = {
> +#define BUILTIN_COMMIT_GRAPH_WRITE_USAGE \
> + N_("git commit-graph write [--object-dir <objdir>] [--append] " \
> + "[--split[=<strategy>]] [--reachable|--stdin-packs|--stdin-commits] " \
> + "[--changed-paths] [--[no-]max-new-filters <n>] [--[no-]progress] " \
> + "<split options>")
> + BUILTIN_COMMIT_GRAPH_WRITE_USAGE,
> NULL
> };This seemed very unnatural to me, but it all makes sense in the end:
Show 5 quoted lines
> +static char const * const builtin_commit_graph_usage[] = {
> + BUILTIN_COMMIT_GRAPH_VERIFY_USAGE,
> + BUILTIN_COMMIT_GRAPH_WRITE_USAGE,
> + NULL,
> };Clever!
Thanks, -Stolee