From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Alangi Derick <alangiderick@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Patch that modifies git usage message
Date: Fri, 1 May 2015 09:55:21 -0700 [thread overview]
Message-ID: <CAGZ79kY4zJ2EhrtinaWChX=hLKywFu38wpF-mo=xrturxVh0=g@mail.gmail.com> (raw)
In-Reply-To: <xmqqfv7gxnup.fsf@gitster.dls.corp.google.com>
On Fri, May 1, 2015 at 9:29 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>> For the patch itself:
>>
>> $ grep -r usage *.c builtin/*.c |wc -l
>> 551
>> $ grep -r Usage *.c builtin/*.c |wc -l
>> 3
>>
>> The community agreed (maybe subconciously) to prefer lower case
>> for the 'usage' string, so I don't think this is an improvement.
>
> I tend to agree with the conclusion, but you need to be a bit
> careful here. These catch all the variable names that contain
> "[uU]sage" as substring, but we do not spell in-code variables
> with camelCase, so the former probably is over-counting. Things
> like "static const char usage[] = ..." are counted; so are calls
> to usage_with_options().
I knew my search was off as I did not think it through, but I
just wanted to have at least some data to not be hand waving only
here.
Maybe we can also rely on the colon in this case:
$ grep -r "usage:" *.{c,sh,perl}
finds 22 results, 21 thereof look like human readable usage instructions
$ grep -r "Usage:" *.{c,sh,perl}
finds 2 results which look like human readable text
>
> If you look for the beginning of a string constant, you would get
> this:
>
> $ git grep '"usage' -- \*.c builtin/\*.c
> 12
> $ git grep '"Usage' -- \*.c builtin/\*.c
> 0
>
> The former undercounts the messages because many usage messages are
> produced by calling usage_with_options() these days.
>
> The latter being zero made me scratch my head and do this:
>
> $ git grep Usage -- \*.c builtin/\*.c
> commit.c: * Usage example:
> test-hashmap.c: * Usage: time echo "perfhas...
>
> I cannot find the third one you found for "Usage" in your example,
> though.
test-submodule-config.c: fprintf(stderr, "Usage: %s [<commit>
<submodulepath>] ...\n", argv[0]);
(I just realize HEAD wa pointing somewhere in pu)
prev parent reply other threads:[~2015-05-01 16:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-01 11:01 Patch that modifies git usage message Alangi Derick
2015-05-01 15:51 ` Stefan Beller
2015-05-01 15:54 ` Alangi Derick
2015-05-01 16:29 ` Junio C Hamano
2015-05-01 16:38 ` Alangi Derick
2015-05-01 16:55 ` Stefan Beller
2015-05-01 17:40 ` Eric Sunshine
2015-05-01 17:49 ` Alangi Derick
2015-05-01 18:01 ` Eric Sunshine
2015-05-01 16:55 ` Stefan Beller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGZ79kY4zJ2EhrtinaWChX=hLKywFu38wpF-mo=xrturxVh0=g@mail.gmail.com' \
--to=sbeller@google.com \
--cc=alangiderick@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).