Re: [PATCH] fix "git log -i --grep"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 25, 2008, 06:27 UTC
- Message-ID
- <7vzln1hann.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20080825061504.GA9313@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> I worked up this patch, and it is below. However, I think it may not be > a good idea, because... > >> The only issue I still have, which I suspect your fix has made it easier >> to address, is to complain if sub-options to grep like -i and -E are given >> without --grep. That's not something v1.5.6 series did, though. > > This is trivial with my first patch, but not with the second. With > grep_filter kept as a pointer, we know that if the pointer is non-NULL > but there are no patterns, then the user asked for grep options but > never --grep.
Hmm, that's true --- instead you would need to introduce a new flag in rev_info that records if you saw any grep sub-options, if we want to check this condition.
> I guess this might be a helpful thing for some users, but I wonder if it > is being too unpredictable for script usage. I.e., a script like: > > git log -E `for i in "$@"; do echo --author=$i`
Ok, that's true, so let's not worry about making "log -i without --grep" an error.
> Anyway, the non-allocating patch is below. Aside from the test case, it > deletes more lines than it adds, which is always nice.
Yeah, thanks.