Re: [RFC PATCH 1/2] Allow "git log --grep foo" as synonym for "git log --grep=foo".
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 27, 2010, 12:21 UTC
- Message-ID
- <AANLkTikcKd4nEZuot5fyZyiLqwAWl4gQyqtNg2512SKM@mail.gmail.com>
- In-Reply-To
- <vpqsk355ea6.fsf@bauges.imag.fr>
On Tue, Jul 27, 2010 at 11:56, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
Show 15 quoted lines
> Ævar Arnfjörð Bjarmason <avarab@gmail.com> writes:
>
>> On Mon, Jul 26, 2010 at 18:14, Matthieu Moy <Matthieu.Moy@imag.fr> wrote:
>>
>>> + } else if (!strcmp(arg, "--grep")) {
>>> + add_message_grep(revs, optarg);
>>> + return 2;
>>
>> This looks good. I've been bitten by git-log's non-standard option
>> parsing. But there's still a lot of options that need the =, no?:
>
> Sure, that's why the patch is just an RFC. I wanted to start the
> discussion before diving into the repetitive task or migration to
> parse-option for others, and I picked --grep and -S because they're
> the ones which annoys me the most.Ah, there was nothing to indicate that, so I thought I'd mention the rest. I look forward to seeing what you'll come up with to consolidate the option parsing later on.
Jakub's suggestion seems particularly interesting, maybe we can use the optparse lib here with some modifications to allow it to parse a subset of the total number of options.