Re: [RFC PATCH 1/2] Allow "git log --grep foo" as synonym for "git log --grep=foo".
- From
Miles Bader <miles@gnu.org>
- Date
- Jul 27, 2010, 08:40 UTC
- Message-ID
- <buohbjll3l9.fsf@dhlpc061.dev.necel.com>
- In-Reply-To
- <AANLkTikGPMDvxQKjpKOBge8UwrC_GuC36_=C_tYR_ngr@mail.gmail.com>
Sverre Rabbelier <srabbelier@gmail.com> writes:
Show 7 quoted lines
>> + } else if (!strcmp(arg, "--grep")) {
>> + add_message_grep(revs, optarg);
>> + return 2;
>
> This one makes a little less sense since to me '--flag' are always
> booleans, whereas '-m' can take an argument (such as '-m' from 'git
> commit'.The fact that --grep requires the "=" is amazingly confusing if you're used to standard GNU long-argument parsing (which many standard utilities use, and which git's argument syntax is clearly modelled after), where both forms are equivalent, and documentation typically only refers to the "=" form, but implicitly allows the separate-args form.
I'm continually getting tripped up by git's idiosynchratic argument parsing, and it's nice to see it getting cleaned up a bit...
-Miles
-- The trouble with most people is that they think with their hopes or fears or wishes rather than with their minds. -- Will Durant