From: Derrick Stolee Date: Tue, 16 Feb 2021 11:33:16 GMT Subject: Re: [PATCH 1/5] commit-graph: define common usage with a macro 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: > +static const char * builtin_commit_graph_verify_usage[] = { > +#define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \ > + N_("git commit-graph verify [--object-dir ] [--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 ] [--append] " \ > + "[--split[=]] [--reachable|--stdin-packs|--stdin-commits] " \ > + "[--changed-paths] [--[no-]max-new-filters ] [--[no-]progress] " \ > + "") > + BUILTIN_COMMIT_GRAPH_WRITE_USAGE, > NULL > }; This seemed very unnatural to me, but it all makes sense in the end: > +static char const * const builtin_commit_graph_usage[] = { > + BUILTIN_COMMIT_GRAPH_VERIFY_USAGE, > + BUILTIN_COMMIT_GRAPH_WRITE_USAGE, > + NULL, > }; Clever! Thanks, -Stolee