Re: [PATCH] fix "git log -i --grep"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux