Re: [PATCH 3/3] builtin/grep: allow implicit --no-index
- From
Thomas Gummerer <t.gummerer@gmail.com>
- Date
- Jan 11, 2016, 21:01 UTC
- Message-ID
- <20160111210102.GE10612@hank>
- In-Reply-To
- <xmqqio2zx5mz.fsf@gitster.mtv.corp.google.com>
On 01/11, Junio C Hamano wrote:
Show 12 quoted lines
> Junio C Hamano <gitster@pobox.com> 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.
Show 8 quoted lines
> 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.