Junio C Hamano <gits...@pobox.com> writes:

> Stepan Kasal <ka...@ucw.cz> writes:
>
>> From: Johannes Schindelin <johannes.schinde...@gmx.de>
>> Date: Tue, 8 Feb 2011 00:17:24 -0600
>>
>> Signed-off-by: Johannes Schindelin <johannes.schinde...@gmx.de>
>> Signed-off-by: Stepan Kasal <ka...@ucw.cz>
>> ---
>> Hi,
>> this patch has been in msysgit for 3 1/4 years.
>>   Stepan
>>
>>  builtin/grep.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/builtin/grep.c b/builtin/grep.c
>> index 8073fbe..6c82a29 100644
>> --- a/builtin/grep.c
>> +++ b/builtin/grep.c
>> @@ -897,6 +897,9 @@ int cmd_grep(int argc, const char **argv, const char 
>> *prefix)
>>              if (len > 4 && is_dir_sep(pager[len - 5]))
>>                      pager += len - 4;
>>  
>> +            if (opt.ignore_case && !strcmp("less", pager))
>> +                    string_list_append(&path_list, "-i");
>
> I have a feeling that this goes against the recent trend of not
> mucking with the expectation of the users on their pagers, if I
> recall correctly the arguments for dropping S from the default given
> to an unconfigured LESS environment variable.

I had the same feeling about "we're doing magic in corner-cases, makes
it hard for the user to understand what's going on". But the patch
actually makes a lot of sense. Without the patch, I get

  $ git grep -O -i no_openssl
  Pattern not found  (press RETURN)

with the patch, I do get a file opened and NO_OPENSSL selected.

The lines right below the ones of the patch are aleady (documented)
less+vi magic, which actually require the patch to behave well in the
presence of -i.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to