Subject: Re: [PATCH 3/3] builtin/grep: allow implicit --no-index

From: Thomas Gummerer <[email-masked]>
Date: Mon, 11 Jan 2016 22:01:02 +0100

On 01/11, Junio C Hamano wrote:
> Junio C Hamano <[email-masked]> writes:
>
> > I however fail to see why that necessitates to change use_index to
> > no_index, making the code harder to follow by introducing double
> > negation.
>
> Oh, perhaps your thinking is that there are multiple ways that
> use_index can become 0 (i.e. it could come from the config, could
> come from an explicit --no-index, or it could come from the new
> default behaviour), and the error messages deep in the callchain
> (long after option parsing is done) want to react to these
> differences.

Yes, that's what I was thinking, sorry if I wasn't clear before.
Though I think the a bit more generic error messages are just fine, so
we can avoid the double negation.

> To that I am somewhat sympathetic, but then use_index can become 1
> (rather, no_index can become 0) in multiple ways (i.e. it can be
> because the user is just using the command as designed for its
> primary use case, or the user explicitly said --no-no-index), so I
> am not sure.
>
> In either case, I do not have a strong objection.  Avoiding double
> negation is merely a moderately strong general preference.