Re: [PATCH v2 01/10] builtin/cat-file: rename variable that tracks usage
On Tue, Apr 01, 2025 at 02:51:01AM -0700, Karthik Nayak wrote:
Show 28 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
>
> > The usage strings for git-cat-file(1) that we pass to `parse_options()`
> > and `usage_msg_optf()` are stored in a variable called `usage`. This
> > variable shadows the declaration of `usage()`, which we'll want to use
> > in a subsequent commit.
> >
> > Rename the variable to `builtin_catfile_usage`, which is in line with
> > how the variable is typically called in other builtins.
> >
> > Signed-off-by: Patrick Steinhardt <ps@pks.im>
> > ---
> > builtin/cat-file.c | 32 ++++++++++++++++----------------
> > 1 file changed, 16 insertions(+), 16 deletions(-)
> >
> > diff --git a/builtin/cat-file.c b/builtin/cat-file.c
> > index b13561cf73b..8e40016dd24 100644
> > --- a/builtin/cat-file.c
> > +++ b/builtin/cat-file.c
> > @@ -941,7 +941,7 @@ int cmd_cat_file(int argc,
> > int input_nul_terminated = 0;
> > int nul_terminated = 0;
> >
> > - const char * const usage[] = {
> > + const char * const builtin_catfile_usage[] = {
>
> Nit: Style: we use a right pointer alignment, while it is not part of
> your code change, would be nice to fix.Not in this case though:
$ git grep 'const char \*const' | wc -l
85
$ git grep 'const char \* const' | wc -l
180
It's mixed, but we do have more cases of the latter.
Patrick