Re: [PATCH 3/3] builtin/grep: allow implicit --no-index
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 11, 2016, 18:37 UTC
- Message-ID
- <xmqqvb70vu6e.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20160111175919.GA11724@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> On Mon, Jan 11, 2016 at 06:48:17PM +0100, Thomas Gummerer wrote: > >> What about a user though who accidentally runs git grep outside of a >> repository, and is usually warned by git failing quickly, whereas with >> the changed behavior some time might go by until the user realizes the >> error. Not sure if we want to support this use case or not? > > Yeah, I don't think git would be _wrong_ here, but I could certainly see > it being annoying. Several times a week I probably run `git grep` in my > home directory, and after seeing its error, realize "oops, I meant to > `cd git`". > ... > ..., it sure would be nice not to > have to say "deal with it; it's the new behavior and there is no escape > hatch".
Ahh, you two are absolutely right.
I assumed people (after making their new year's resolutions) will be perfect this year and from now on, and I totally forgot about the case where somebody runs it by mistake.
"grep.fallbacktoNoindex = true/false" that is by default 'false' would be our usual approach, then.
Thanks for pointing it out.