Re: Patch that modifies git usage message
- From
Alangi Derick <alangiderick@gmail.com>
- Date
- May 1, 2015, 16:38 UTC
- Message-ID
- <CAKB+oNtKi6e7H9U75WEJDKH2KK349JT+vGE8+acHvM6SasCWfQ@mail.gmail.com>
- In-Reply-To
- <xmqqfv7gxnup.fsf@gitster.dls.corp.google.com>
Ok, thanks for the correction. What about the other strings used for error display? For example die("cannot handle %s as a builtin", cmd); Can't i change the "cannot" to "Cannot"? Or is there a problem with that one too? Regards Alangi Derick Ndimnain
On Fri, May 1, 2015 at 5:29 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 38 quoted lines
> 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(). > > 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.