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

From: Junio C Hamano <[email-masked]>
Date: Mon, 11 Jan 2016 10:37:45 -0800

Jeff King <[email-masked]> writes:

> 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.