{"thread":{"id":"36656","subject":"[PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","startedAt":"2014-05-14T15:50:10Z","lastAt":"2014-05-15T19:48:48Z","messageCount":14,"participants":["Stepan Kasal","Junio C Hamano","Matthieu Moy","Jonathan Nieder","Jeff King","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"241507","messageId":"20140514155010.GA4592@camelia.ucw.cz","threadId":"36656","inReplyTo":null,"subject":"[PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Stepan Kasal","fromEmail":"kasal@ucw.cz","sentAt":"2014-05-14T15:50:10Z","receivedAt":"2014-05-14T15:50:10Z","isPatch":true,"sender":{"key":"kasal@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/1481596?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\nDate: Tue, 8 Feb 2011 00:17:24 -0600\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Stepan Kasal <kasal@ucw.cz>\n---\nHi,\nthis patch has been in msysgit for 3 1/4 years.\n  Stepan\n\n builtin/grep.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex 8073fbe..6c82a29 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -897,6 +897,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\tif (len > 4 && is_dir_sep(pager[len - 5]))\n \t\t\tpager += len - 4;\n \n+\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n+\t\t\tstring_list_append(&path_list, \"-i\");\n+\n \t\tif (!strcmp(\"less\", pager) || !strcmp(\"vi\", pager)) {\n \t\t\tstruct strbuf buf = STRBUF_INIT;\n \t\t\tstrbuf_addf(&buf, \"+/%s%s\",\n-- \n1.9.2.msysgit.0.335.gd2a461f\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241515","messageId":"xmqq7g5okztp.fsf@gitster.dls.corp.google.com","threadId":"36656","inReplyTo":"20140514155010.GA4592@camelia.ucw.cz","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-05-14T17:57:54Z","receivedAt":"2014-05-14T17:57:54Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stepan Kasal <kasal@ucw.cz> writes:\n\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Date: Tue, 8 Feb 2011 00:17:24 -0600\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Signed-off-by: Stepan Kasal <kasal@ucw.cz>\n> ---\n> Hi,\n> this patch has been in msysgit for 3 1/4 years.\n>   Stepan\n>\n>  builtin/grep.c | 3 +++\n>  1 file changed, 3 insertions(+)\n>\n> diff --git a/builtin/grep.c b/builtin/grep.c\n> index 8073fbe..6c82a29 100644\n> --- a/builtin/grep.c\n> +++ b/builtin/grep.c\n> @@ -897,6 +897,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n>  \t\tif (len > 4 && is_dir_sep(pager[len - 5]))\n>  \t\t\tpager += len - 4;\n>  \n> +\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n> +\t\t\tstring_list_append(&path_list, \"-i\");\n\nI have a feeling that this goes against the recent trend of not\nmucking with the expectation of the users on their pagers, if I\nrecall correctly the arguments for dropping S from the default given\nto an unconfigured LESS environment variable.\n\n>  \t\tif (!strcmp(\"less\", pager) || !strcmp(\"vi\", pager)) {\n>  \t\t\tstruct strbuf buf = STRBUF_INIT;\n>  \t\t\tstrbuf_addf(&buf, \"+/%s%s\",\n> -- \n> 1.9.2.msysgit.0.335.gd2a461f\n>\n> -- \n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241516","messageId":"vpqha4sfcqw.fsf@anie.imag.fr","threadId":"36656","inReplyTo":"xmqq7g5okztp.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-05-14T18:15:19Z","receivedAt":"2014-05-14T18:15:19Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Stepan Kasal <kasal@ucw.cz> writes:\n>\n>> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> Date: Tue, 8 Feb 2011 00:17:24 -0600\n>>\n>> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n>> Signed-off-by: Stepan Kasal <kasal@ucw.cz>\n>> ---\n>> Hi,\n>> this patch has been in msysgit for 3 1/4 years.\n>>   Stepan\n>>\n>>  builtin/grep.c | 3 +++\n>>  1 file changed, 3 insertions(+)\n>>\n>> diff --git a/builtin/grep.c b/builtin/grep.c\n>> index 8073fbe..6c82a29 100644\n>> --- a/builtin/grep.c\n>> +++ b/builtin/grep.c\n>> @@ -897,6 +897,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n>>  \t\tif (len > 4 && is_dir_sep(pager[len - 5]))\n>>  \t\t\tpager += len - 4;\n>>  \n>> +\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n>> +\t\t\tstring_list_append(&path_list, \"-i\");\n>\n> I have a feeling that this goes against the recent trend of not\n> mucking with the expectation of the users on their pagers, if I\n> recall correctly the arguments for dropping S from the default given\n> to an unconfigured LESS environment variable.\n\nI had the same feeling about \"we're doing magic in corner-cases, makes\nit hard for the user to understand what's going on\". But the patch\nactually makes a lot of sense. Without the patch, I get\n\n  $ git grep -O -i no_openssl\n  Pattern not found  (press RETURN)\n\nwith the patch, I do get a file opened and NO_OPENSSL selected.\n\nThe lines right below the ones of the patch are aleady (documented)\nless+vi magic, which actually require the patch to behave well in the\npresence of -i.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"241517","messageId":"20140514182654.GA9218@google.com","threadId":"36656","inReplyTo":"xmqq7g5okztp.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-05-14T18:26:54Z","receivedAt":"2014-05-14T18:26:54Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nJunio C Hamano wrote:\n> Stepan Kasal <kasal@ucw.cz> writes:\n\n>> --- a/builtin/grep.c\n>> +++ b/builtin/grep.c\n>> @@ -897,6 +897,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n>>  \t\tif (len > 4 && is_dir_sep(pager[len - 5]))\n>>  \t\t\tpager += len - 4;\n>>  \n>> +\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n>> +\t\t\tstring_list_append(&path_list, \"-i\");\n>\n> I have a feeling that this goes against the recent trend of not\n> mucking with the expectation of the users on their pagers, if I\n> recall correctly the arguments for dropping S from the default given\n> to an unconfigured LESS environment variable.\n\nIt's just missing an explanation.\n\nWhen <command> happens to be the magic string \"less\", today\n\n\tgit grep -O<command> -e<pattern>\n\nhelpfully passes +/<pattern> to less so you can navigate through\nthe results within a file using the n and shift+n keystrokes.\n\nAlas, that doesn't do the right thing for a case-insensitive match.\nFor that case we should pass --IGNORE-CASE to \"less\" so that n and\nshift+n can move between results ignoring case in the pattern.\n(That's -I, not -i, because it ought to work even when the pattern\ncontains capital letters.)\n\n\"git grep\" has other options that affect interpretation of the pattern\nwhich this patch does not help with:\n\n * -v / --ignore-match: probably should disable this feature of -O.\n * -E / --extended-regexp\n * -P / --perl-regexp\n * -F / --fixed-strings: ideally would auto-escape regex specials.\n * -e<pattern1> --or -e<pattern2>\n\nAnd git grep -Ovi has a similar bug, for which the fix is to add\n\\c to the pattern instead of passing an -I option.\n\nBut as is, it's an improvement, so (except that \"-i\" should be\nreplaced by \"-I\") it seems like a good change.\n\nHope that helps,\nJonathan\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241519","messageId":"xmqqvbt8jjlg.fsf@gitster.dls.corp.google.com","threadId":"36656","inReplyTo":"20140514182654.GA9218@google.com","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-05-14T18:33:47Z","receivedAt":"2014-05-14T18:33:47Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>>> +\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n>>> +\t\t\tstring_list_append(&path_list, \"-i\");\n>>\n>> I have a feeling that this goes against the recent trend of not\n>> mucking with the expectation of the users on their pagers, if I\n>> recall correctly the arguments for dropping S from the default given\n>> to an unconfigured LESS environment variable.\n>\n> It's just missing an explanation.\n> ...\n> (That's -I, not -i, because it ought to work even when the pattern\n> contains capital letters.)\n\nSpot on.  The change, especially with \"-I\", makes sense.\n\nThanks.\n"},{"id":"241518","messageId":"20140514183527.GA5422@camelia.ucw.cz","threadId":"36656","inReplyTo":"20140514182654.GA9218@google.com","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Stepan Kasal","fromEmail":"kasal@ucw.cz","sentAt":"2014-05-14T18:35:27Z","receivedAt":"2014-05-14T18:35:27Z","isPatch":true,"sender":{"key":"kasal@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/1481596?v=4"},"body":"Hello,\n\nOn Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote:\n> But as is, it's an improvement, so (except that \"-i\" should be\n> replaced by \"-I\") it seems like a good change.\n\nindeed, \"-I\" would match the semantics of git-grep -i .\n\nStepan\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241521","messageId":"20140514190716.GA2715@sigill.intra.peff.net","threadId":"36656","inReplyTo":"20140514182654.GA9218@google.com","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-05-14T19:07:17Z","receivedAt":"2014-05-14T19:07:17Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote:\n\n> \"git grep\" has other options that affect interpretation of the pattern\n> which this patch does not help with:\n> \n>  * -v / --ignore-match: probably should disable this feature of -O.\n>  * -E / --extended-regexp\n>  * -P / --perl-regexp\n>  * -F / --fixed-strings: ideally would auto-escape regex specials.\n>  * -e<pattern1> --or -e<pattern2>\n> \n> And git grep -Ovi has a similar bug, for which the fix is to add\n> \\c to the pattern instead of passing an -I option.\n\nWe've already found the lines of interest to the user. It would be nice\nif we could somehow point the pager at them by number, rather than\nrepeating the (slightly incompatible) search.\n\nWe can do \"less +25\", but that only points it to the first instance (and\ndoesn't highlight it), whereas the current code lets the repeat-search\nfind other instances. I don't think there's a way to queue up a set of\ninteresting lines to visit in less. At least I could not think of one.\n\nThis is more or less how I ended up at the design of contrib/git-jump,\nwhich uses quickfix lists to make such a queue (only editors\nunderstand those, not pagers, but I consider being dumped into the\neditor a feature :) ).\n\n> But as is, it's an improvement, so (except that \"-i\" should be\n> replaced by \"-I\") it seems like a good change.\n\nAgreed. Thanks for the list of problematic options.\n\n-Peff\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241751","messageId":"alpine.DEB.1.00.1405151943310.14982@s15462909.onlinehome-server.info","threadId":"36656","inReplyTo":"xmqqvbt8jjlg.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2014-05-15T17:44:08Z","receivedAt":"2014-05-15T17:44:08Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 14 May 2014, Junio C Hamano wrote:\n\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n> \n> >>> +\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n> >>> +\t\t\tstring_list_append(&path_list, \"-i\");\n> >>\n> >> I have a feeling that this goes against the recent trend of not\n> >> mucking with the expectation of the users on their pagers, if I\n> >> recall correctly the arguments for dropping S from the default given\n> >> to an unconfigured LESS environment variable.\n> >\n> > It's just missing an explanation.\n> > ...\n> > (That's -I, not -i, because it ought to work even when the pattern\n> > contains capital letters.)\n> \n> Spot on.  The change, especially with \"-I\", makes sense.\n\nExcept that it was not tested with -I. If you change it that way and it\nstops working on Windows, it's useless to me.\n\nCiao,\nJohannes\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241752","messageId":"alpine.DEB.1.00.1405151944410.14982@s15462909.onlinehome-server.info","threadId":"36656","inReplyTo":"20140514190716.GA2715@sigill.intra.peff.net","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2014-05-15T17:46:49Z","receivedAt":"2014-05-15T17:46:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Peff,\n\nOn Wed, 14 May 2014, Jeff King wrote:\n\n> On Wed, May 14, 2014 at 11:26:54AM -0700, Jonathan Nieder wrote:\n> \n> > \"git grep\" has other options that affect interpretation of the pattern\n> > which this patch does not help with:\n> > \n> >  * -v / --ignore-match: probably should disable this feature of -O.\n> >  * -E / --extended-regexp\n> >  * -P / --perl-regexp\n> >  * -F / --fixed-strings: ideally would auto-escape regex specials.\n> >  * -e<pattern1> --or -e<pattern2>\n> > \n> > And git grep -Ovi has a similar bug, for which the fix is to add\n> > \\c to the pattern instead of passing an -I option.\n> \n> We've already found the lines of interest to the user. It would be nice\n> if we could somehow point the pager at them by number, rather than\n> repeating the (slightly incompatible) search.\n\nFWIW it is exactly that type of \"I want your patch to do more than you do\"\ntype of comments that makes it impossible for myself to contribute patches\nanymore. It just does not fit inside my Git time budget anymore.\n\nBesides, it breaks exactly the intended usage. My intent is not just to\nsee the matching lines in the pager, but to be able to adjust the search\npattern further if needed. Your suggestion completely breaks that usage.\n\nCiao,\nJohannes\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241753","messageId":"20140515175344.GM9218@google.com","threadId":"36656","inReplyTo":"alpine.DEB.1.00.1405151943310.14982@s15462909.onlinehome-server.info","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-05-15T17:53:44Z","receivedAt":"2014-05-15T17:53:44Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n> On Wed, 14 May 2014, Junio C Hamano wrote:\n\n>> Spot on.  The change, especially with \"-I\", makes sense.\n>\n> Except that it was not tested with -I. If you change it that way and it\n> stops working on Windows, it's useless to me.\n\nAre you saying that less on Windows doesn't have an \"-I\" option?\nversion.c tells me it was added in v266 (1994-12-26).\n\nIf \"-I' is in fact broken on Windows, that would be useful to know,\nbut it's not clear to me.  Or if I have misunderstood what\n\n\tgit grep -i -Oless -eGit_\n\nis supposed to do, that would help, too.\n\nPuzzled,\nJonathan\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241754","messageId":"20140515175614.GN9218@google.com","threadId":"36656","inReplyTo":"alpine.DEB.1.00.1405151944410.14982@s15462909.onlinehome-server.info","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-05-15T17:56:14Z","receivedAt":"2014-05-15T17:56:14Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Johannes Schindelin wrote:\n> On Wed, 14 May 2014, Jeff King wrote:\n\n>> We've already found the lines of interest to the user. It would be nice\n>> if we could somehow point the pager at them by number, rather than\n>> repeating the (slightly incompatible) search.\n>\n> FWIW it is exactly that type of \"I want your patch to do more than you do\"\n> type of comments that makes it impossible for myself to contribute patches\n> anymore.\n\nI think you're overreacting to Peff's \"It would be nice\".\n\nIt is a way of talking about where this lies in a design space that\nalso includes the git-jump tool that Peff worked on.  Maybe the tools\ncan learn from each other.  It is not a reason not to apply the patch.\n\nJonathan\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241764","messageId":"alpine.DEB.1.00.1405152100350.14982@s15462909.onlinehome-server.info","threadId":"36656","inReplyTo":"20140515175344.GM9218@google.com","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2014-05-15T19:01:44Z","receivedAt":"2014-05-15T19:01:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Thu, 15 May 2014, Jonathan Nieder wrote:\n\n> Johannes Schindelin wrote:\n> > On Wed, 14 May 2014, Junio C Hamano wrote:\n> \n> >> Spot on.  The change, especially with \"-I\", makes sense.\n> >\n> > Except that it was not tested with -I. If you change it that way and it\n> > stops working on Windows, it's useless to me.\n> \n> Are you saying that less on Windows doesn't have an \"-I\" option?\n\nI did not say that.\n\n> version.c tells me it was added in v266 (1994-12-26).\n\nThanks. That was the thing I was really looking for: an indication that -I\nis not a new-fangled thing but a well-tested option that even old greps\nhave.\n\nCiao,\nDscho\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241769","messageId":"20140515191824.GB29746@sigill.intra.peff.net","threadId":"36656","inReplyTo":"alpine.DEB.1.00.1405151944410.14982@s15462909.onlinehome-server.info","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2014-05-15T19:18:24Z","receivedAt":"2014-05-15T19:18:24Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, May 15, 2014 at 07:46:49PM +0200, Johannes Schindelin wrote:\n\n> > We've already found the lines of interest to the user. It would be nice\n> > if we could somehow point the pager at them by number, rather than\n> > repeating the (slightly incompatible) search.\n> \n> FWIW it is exactly that type of \"I want your patch to do more than you do\"\n> type of comments that makes it impossible for myself to contribute patches\n> anymore. It just does not fit inside my Git time budget anymore.\n\nI'm sorry you took it that way. What I meant to say was \"it would be\nnice if we could do it this other way, which is more robust, but I don't\nthink it is easy.  Let's take the patch\". I.e., when I later said:\n\n>>> But as is, it's an improvement, so (except that \"-i\" should be\n>>> replaced by \"-I\") it seems like a good change.\n>>\n>>Agreed. Thanks for the list of problematic options.\n\nthe \"agreed\" there is with \"it seems like a good change\".\n\nAnd I also wanted to point people to existing work, if they did want to\nexplore doing it that other way.  I really didn't expect anything from\nyou (beyond s/i/I/, as Jonathan suggested).\n\n> Besides, it breaks exactly the intended usage. My intent is not just to\n> see the matching lines in the pager, but to be able to adjust the search\n> pattern further if needed. Your suggestion completely breaks that usage.\n\nThanks, this is a point I hadn't considered.\n\n-Peff\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241780","messageId":"xmqqha4qesbj.fsf@gitster.dls.corp.google.com","threadId":"36656","inReplyTo":"alpine.DEB.1.00.1405151943310.14982@s15462909.onlinehome-server.info","subject":"Re: [PATCH] git grep -O -i: if the pager is 'less', pass the '-i' option","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-05-15T19:48:48Z","receivedAt":"2014-05-15T19:48:48Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n>> Jonathan Nieder <jrnieder@gmail.com> writes:\n>> \n>> >>> +\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n>> >>> +\t\t\tstring_list_append(&path_list, \"-i\");\n>> >>\n>> >> I have a feeling that this goes against the recent trend of not\n>> >> mucking with the expectation of the users on their pagers, if I\n>> >> recall correctly the arguments for dropping S from the default given\n>> >> to an unconfigured LESS environment variable.\n>> >\n>> > It's just missing an explanation.\n>> > ...\n>> > (That's -I, not -i, because it ought to work even when the pattern\n>> > contains capital letters.)\n>> \n>> Spot on.  The change, especially with \"-I\", makes sense.\n>\n> Except that it was not tested with -I. If you change it that way and it\n> stops working on Windows, it's useless to me.\n\nThat is all true, and I didn't test on Windows, but it seems that\nthe feature is very old in the upstream that we can rely on, so\nlet's take Jonathan's explanation and queue somethink like this.\n\n-- >8 --\nFrom: Johannes Schindelin <johannes.schindelin@gmx.de>\nDate: Tue, 8 Feb 2011 00:17:24 -0600\nSubject: [PATCH] git grep -O -i: if the pager is 'less', pass the '-I' option\n\nWhen <command> happens to be the magic string \"less\", today\n\n\tgit grep -O<command> -e<pattern>\n\nhelpfully passes +/<pattern> to less so you can navigate through\nthe results within a file using the n and shift+n keystrokes.\n\nAlas, that doesn't do the right thing for a case-insensitive match,\ni.e.\n\n\tgit grep -i -O<command> -e<pattern>\n\nFor that case we should pass --IGNORE-CASE to \"less\" so that n and\nshift+n can move between results ignoring case in the pattern.\n\nThe original patch came from msysgit and used \"-i\", but that was not\ndue to lack of support for \"-I\" but it merely overlooked that it\nought to work even when the pattern contains capital letters.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Stepan Kasal <kasal@ucw.cz>\nHelped-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n builtin/grep.c | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/builtin/grep.c b/builtin/grep.c\nindex 63f8603..c0573d0 100644\n--- a/builtin/grep.c\n+++ b/builtin/grep.c\n@@ -876,6 +876,9 @@ int cmd_grep(int argc, const char **argv, const char *prefix)\n \t\tif (len > 4 && is_dir_sep(pager[len - 5]))\n \t\t\tpager += len - 4;\n \n+\t\tif (opt.ignore_case && !strcmp(\"less\", pager))\n+\t\t\tstring_list_append(&path_list, \"-I\");\n+\n \t\tif (!strcmp(\"less\", pager) || !strcmp(\"vi\", pager)) {\n \t\t\tstruct strbuf buf = STRBUF_INIT;\n \t\t\tstrbuf_addf(&buf, \"+/%s%s\",\n-- \n2.0.0-rc3-419-gdb851f2\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"}]}