threads / patch / 36656

patchgit grep -O -i: if the pager is 'less', pass the '-i' option

Subject: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

## tl;dr

14 messages between May 14, 2014 and May 15, 2014. Diffs are folded; open one to read it.

replies: 13people: 6as markdown or json

Stepan Kasal· May 14, 2014, 15:50 UTC · lore
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 8 Feb 2011 00:17:24 -0600
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
---
Hi,
this patch has been in msysgit for 3 1/4 years.
  Stepan
 builtin/grep.c | 3 +++
 1 file changed, 3 insertions(+)
Show changes to builtin/grep.c +3 −0
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");
+
 		if (!strcmp("less", pager) || !strcmp("vi", pager)) {
 			struct strbuf buf = STRBUF_INIT;
 			strbuf_addf(&buf, "+/%s%s",
-- 
1.9.2.msysgit.0.335.gd2a461f

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano· May 14, 2014, 17:57 UTC · re: Stepan Kasal · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Stepan Kasal <kasal@ucw.cz> writes:
Show 23 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> Date: Tue, 8 Feb 2011 00:17:24 -0600
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> Signed-off-by: Stepan Kasal <kasal@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.

Show 7 quoted lines
>  		if (!strcmp("less", pager) || !strcmp("vi", pager)) {
>  			struct strbuf buf = STRBUF_INIT;
>  			strbuf_addf(&buf, "+/%s%s",
> -- 
> 1.9.2.msysgit.0.335.gd2a461f
>
> -- 
-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Matthieu Moy· May 14, 2014, 18:15 UTC · re: Junio C Hamano · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Junio C Hamano <gitster@pobox.com> writes:
Show 30 quoted lines
> Stepan Kasal <kasal@ucw.cz> writes:
>
>> From: Johannes Schindelin <johannes.schindelin@gmx.de>
>> Date: Tue, 8 Feb 2011 00:17:24 -0600
>>
>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
>> Signed-off-by: Stepan Kasal <kasal@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/
Jonathan Nieder· May 14, 2014, 18:26 UTC · re: Junio C Hamano · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Hi,
Junio C Hamano wrote:
> Stepan Kasal <kasal@ucw.cz> writes:
Show 13 quoted lines
>> --- 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.
It's just missing an explanation.
When <command> happens to be the magic string "less", today
	git grep -O<command> -e<pattern>

helpfully passes +/<pattern> to less so you can navigate through the results within a file using the n and shift+n keystrokes.

Alas, that doesn't do the right thing for a case-insensitive match. For that case we should pass --IGNORE-CASE to "less" so that n and shift+n can move between results ignoring case in the pattern. (That's -I, not -i, because it ought to work even when the pattern contains capital letters.)

"git grep" has other options that affect interpretation of the pattern which this patch does not help with:

 * -v / --ignore-match: probably should disable this feature of -O.
 * -E / --extended-regexp
 * -P / --perl-regexp
 * -F / --fixed-strings: ideally would auto-escape regex specials.
 * -e<pattern1> --or -e<pattern2>

And git grep -Ovi has a similar bug, for which the fix is to add \c to the pattern instead of passing an -I option.

But as is, it's an improvement, so (except that "-i" should be replaced by "-I") it seems like a good change.

Hope that helps, Jonathan

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano· May 14, 2014, 18:33 UTC · re: Jonathan Nieder · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Jonathan Nieder <jrnieder@gmail.com> writes:
Show 12 quoted lines
>>> +		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.
>
> It's just missing an explanation.
> ...
> (That's -I, not -i, because it ought to work even when the pattern
> contains capital letters.)
Spot on.  The change, especially with "-I", makes sense.
Thanks.
Johannes Schindelin· May 15, 2014, 17:44 UTC · re: Junio C Hamano · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Hi Junio,
On Wed, 14 May 2014, Junio C Hamano wrote:
Show 16 quoted lines
> Jonathan Nieder <jrnieder@gmail.com> writes:
> 
> >>> +		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.
> >
> > It's just missing an explanation.
> > ...
> > (That's -I, not -i, because it ought to work even when the pattern
> > contains capital letters.)
> 
> Spot on.  The change, especially with "-I", makes sense.

Except that it was not tested with -I. If you change it that way and it stops working on Windows, it's useless to me.

Ciao, Johannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan Nieder· May 15, 2014, 17:53 UTC · re: Johannes Schindelin · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Hi,
Johannes Schindelin wrote:
> On Wed, 14 May 2014, Junio C Hamano wrote:
>> Spot on.  The change, especially with "-I", makes sense.
>
> Except that it was not tested with -I. If you change it that way and it
> stops working on Windows, it's useless to me.

Are you saying that less on Windows doesn't have an "-I" option? version.c tells me it was added in v266 (1994-12-26).

If "-I' is in fact broken on Windows, that would be useful to know, but it's not clear to me. Or if I have misunderstood what

	git grep -i -Oless -eGit_
is supposed to do, that would help, too.

Puzzled, Jonathan

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin· May 15, 2014, 19:01 UTC · re: Jonathan Nieder · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Hi,
On Thu, 15 May 2014, Jonathan Nieder wrote:
Show 9 quoted lines
> Johannes Schindelin wrote:
> > On Wed, 14 May 2014, Junio C Hamano wrote:
> 
> >> Spot on.  The change, especially with "-I", makes sense.
> >
> > Except that it was not tested with -I. If you change it that way and it
> > stops working on Windows, it's useless to me.
> 
> Are you saying that less on Windows doesn't have an "-I" option?
I did not say that.
> version.c tells me it was added in v266 (1994-12-26).

Thanks. That was the thing I was really looking for: an indication that -I is not a new-fangled thing but a well-tested option that even old greps have.

Ciao, Dscho

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Junio C Hamano· May 15, 2014, 19:48 UTC · re: Johannes Schindelin · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 19 quoted lines
>> Jonathan Nieder <jrnieder@gmail.com> writes:
>> 
>> >>> +		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.
>> >
>> > It's just missing an explanation.
>> > ...
>> > (That's -I, not -i, because it ought to work even when the pattern
>> > contains capital letters.)
>> 
>> Spot on.  The change, especially with "-I", makes sense.
>
> Except that it was not tested with -I. If you change it that way and it
> stops working on Windows, it's useless to me.

That is all true, and I didn't test on Windows, but it seems that the feature is very old in the upstream that we can rely on, so let's take Jonathan's explanation and queue somethink like this.

-- >8 --
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Tue, 8 Feb 2011 00:17:24 -0600
Subject: [PATCH] git grep -O -i: if the pager is 'less', pass the '-I' option
When <command> happens to be the magic string "less", today
	git grep -O<command> -e<pattern>

helpfully passes +/<pattern> to less so you can navigate through the results within a file using the n and shift+n keystrokes.

Alas, that doesn't do the right thing for a case-insensitive match, i.e.

	git grep -i -O<command> -e<pattern>

For that case we should pass --IGNORE-CASE to "less" so that n and shift+n can move between results ignoring case in the pattern.

The original patch came from msysgit and used "-i", but that was not due to lack of support for "-I" but it merely overlooked that it ought to work even when the pattern contains capital letters.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 builtin/grep.c | 3 +++
 1 file changed, 3 insertions(+)
Show changes to builtin/grep.c +3 −0
diff --git a/builtin/grep.c b/builtin/grep.c
index 63f8603..c0573d0 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -876,6 +876,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");
+
 		if (!strcmp("less", pager) || !strcmp("vi", pager)) {
 			struct strbuf buf = STRBUF_INIT;
 			strbuf_addf(&buf, "+/%s%s",
-- 
2.0.0-rc3-419-gdb851f2

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Stepan Kasal· May 14, 2014, 18:35 UTC · re: Jonathan Nieder · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Hello,
On Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote:
> But as is, it's an improvement, so (except that "-i" should be
> replaced by "-I") it seems like a good change.
indeed, "-I" would match the semantics of git-grep -i .
Stepan
-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeff King· May 14, 2014, 19:07 UTC · re: Jonathan Nieder · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

On Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote:
Show 11 quoted lines
> "git grep" has other options that affect interpretation of the pattern
> which this patch does not help with:
> 
>  * -v / --ignore-match: probably should disable this feature of -O.
>  * -E / --extended-regexp
>  * -P / --perl-regexp
>  * -F / --fixed-strings: ideally would auto-escape regex specials.
>  * -e<pattern1> --or -e<pattern2>
> 
> And git grep -Ovi has a similar bug, for which the fix is to add
> \c to the pattern instead of passing an -I option.

We've already found the lines of interest to the user. It would be nice if we could somehow point the pager at them by number, rather than repeating the (slightly incompatible) search.

We can do "less +25", but that only points it to the first instance (and doesn't highlight it), whereas the current code lets the repeat-search find other instances. I don't think there's a way to queue up a set of interesting lines to visit in less. At least I could not think of one.

This is more or less how I ended up at the design of contrib/git-jump, which uses quickfix lists to make such a queue (only editors understand those, not pagers, but I consider being dumped into the editor a feature :) ).

> But as is, it's an improvement, so (except that "-i" should be
> replaced by "-I") it seems like a good change.
Agreed. Thanks for the list of problematic options.
-Peff
-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Johannes Schindelin· May 15, 2014, 17:46 UTC · re: Jeff King · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Hi Peff,
On Wed, 14 May 2014, Jeff King wrote:
Show 17 quoted lines
> On Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote:
> 
> > "git grep" has other options that affect interpretation of the pattern
> > which this patch does not help with:
> > 
> >  * -v / --ignore-match: probably should disable this feature of -O.
> >  * -E / --extended-regexp
> >  * -P / --perl-regexp
> >  * -F / --fixed-strings: ideally would auto-escape regex specials.
> >  * -e<pattern1> --or -e<pattern2>
> > 
> > And git grep -Ovi has a similar bug, for which the fix is to add
> > \c to the pattern instead of passing an -I option.
> 
> We've already found the lines of interest to the user. It would be nice
> if we could somehow point the pager at them by number, rather than
> repeating the (slightly incompatible) search.

FWIW it is exactly that type of "I want your patch to do more than you do" type of comments that makes it impossible for myself to contribute patches anymore. It just does not fit inside my Git time budget anymore.

Besides, it breaks exactly the intended usage. My intent is not just to see the matching lines in the pager, but to be able to adjust the search pattern further if needed. Your suggestion completely breaks that usage.

Ciao, Johannes

-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jonathan Nieder· May 15, 2014, 17:56 UTC · re: Johannes Schindelin · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

Johannes Schindelin wrote:
> On Wed, 14 May 2014, Jeff King wrote:
Show 7 quoted lines
>> We've already found the lines of interest to the user. It would be nice
>> if we could somehow point the pager at them by number, rather than
>> repeating the (slightly incompatible) search.
>
> FWIW it is exactly that type of "I want your patch to do more than you do"
> type of comments that makes it impossible for myself to contribute patches
> anymore.
I think you're overreacting to Peff's "It would be nice".

It is a way of talking about where this lies in a design space that also includes the git-jump tool that Peff worked on. Maybe the tools can learn from each other. It is not a reason not to apply the patch.

Jonathan
-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Jeff King· May 15, 2014, 19:18 UTC · re: Johannes Schindelin · lore

Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option

On Thu, May 15, 2014 at 07:46:49PM +0200, Johannes Schindelin wrote:
Show 7 quoted lines
> > We've already found the lines of interest to the user. It would be nice
> > if we could somehow point the pager at them by number, rather than
> > repeating the (slightly incompatible) search.
> 
> FWIW it is exactly that type of "I want your patch to do more than you do"
> type of comments that makes it impossible for myself to contribute patches
> anymore. It just does not fit inside my Git time budget anymore.

I'm sorry you took it that way. What I meant to say was "it would be nice if we could do it this other way, which is more robust, but I don't think it is easy. Let's take the patch". I.e., when I later said:

>>> But as is, it's an improvement, so (except that "-i" should be
>>> replaced by "-I") it seems like a good change.
>>
>>Agreed. Thanks for the list of problematic options.
the "agreed" there is with "it seems like a good change".

And I also wanted to point people to existing work, if they did want to explore doing it that other way. I really didn't expect anything from you (beyond s/i/I/, as Jonathan suggested).

> Besides, it breaks exactly the intended usage. My intent is not just to
> see the matching lines in the pager, but to be able to adjust the search
> pattern further if needed. Your suggestion completely breaks that usage.
Thanks, this is a point I hadn't considered.
-Peff
-- 
-- 
*** Please reply-to-all at all times ***
*** (do not pretend to know who is subscribed and who is not) ***
*** Please avoid top-posting. ***
The msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.

You received this message because you are subscribed to the Google
Groups "msysGit" group.
To post to this group, send email to msysgit@googlegroups.com
To unsubscribe from this group, send email to
msysgit+unsubscribe@googlegroups.com
For more options, and view previous threads, visit this group at
http://groups.google.com/group/msysgit?hl=en_US?hl=en

--- 
You received this message because you are subscribed to the Google Groups "msysGit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

← back to recent threads