{"thread":{"id":"18110","subject":"git log -Sfoo ignores indentation (whitespace?) changes...","startedAt":"2009-03-03T14:28:08Z","lastAt":"2009-03-03T18:24:28Z","messageCount":17,"participants":["Peter Valdemar Mørch (Lists)","Jeff King","Junio C Hamano","Michael J Gruber","John Tapsell"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"106840","messageId":"49AD3E78.1050706@sneakemail.com","threadId":"18110","inReplyTo":null,"subject":"git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Peter Valdemar Mørch (Lists)","fromEmail":"4ux6as402@sneakemail.com","sentAt":"2009-03-03T14:28:08Z","receivedAt":"2009-03-03T14:28:08Z","isPatch":false,"sender":{"key":"4ux6as402@sneakemail.com","avatar":null},"body":"Commits where only the indentation of 'foo' is changed are not shown \nwith \"git log -Sfoo\". Is there any way to force showing them along with \nother changes involving foo? (E.g. for python, indentation matters!)\n\nWhy doesn't the second commit show up in the following?\n\n$ git init\n\n# Create text containing 'line' without whitespace\n$ echo 'line' > text\n$ git add text\n$ git commit -m \"first\" text\n\n# Here, I add one space of indentation in front of 'line'\n$ echo ' line' > text\n$ git commit -m \"second\" text\n\n# git log -Sline shows only the first commit, not the second,\n# where the indentation changed.\n$ git log -Sline\ncommit c4481e4b38bb521d91583e5c5a3b2b98f08b7ec0\nAuthor: pvm <pvm@change_me.dk>\nDate:   Tue Mar 3 14:45:38 2009 +0100\n\n     first\n\n# But clearly, the second commit *also* has changes\n# containing 'line':\n$ git log -p HEAD~..HEAD\ncommit 6cb883409aa9ccda00d7720ee9bf4fa59918c5fd\nAuthor: pvm <pvm@change_me.dk>\nDate:   Tue Mar 3 14:45:39 2009 +0100\n\n     second\n\ndiff --git a/text b/text\nindex a999a0c..d650980 100644\n--- a/text\n+++ b/text\n@@ -1 +1 @@\n-line\n+ line\n\nI would like to see both \"first\" and \"second\" somehow - can I do that?\n\n-- \nPeter Valdemar Mørch\nhttp://www.morch.com\n"},{"id":"106847","messageId":"20090303152333.GB24593@coredump.intra.peff.net","threadId":"18110","inReplyTo":"49AD3E78.1050706@sneakemail.com","subject":"Re: git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-03T15:23:33Z","receivedAt":"2009-03-03T15:23:33Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 03, 2009 at 03:28:08PM +0100, \"Peter Valdemar Mørch (Lists)\" wrote:\n\n> Commits where only the indentation of 'foo' is changed are not shown with \n> \"git log -Sfoo\". Is there any way to force showing them along with other \n> changes involving foo? (E.g. for python, indentation matters!)\n>\n> Why doesn't the second commit show up in the following?\n\nBecause you misunderstand how \"-S\" works (but don't worry, it's not your\nfault -- the documentation is somewhat misleading). The documentation says:\n\n  -S<string>\n    Look for differences that contain the change in <string>.\n\nbut what it actually does is find changes where the string was introduced\nor removed. So it literally counts the number of occurences before and\nafter the commit, and the commit is interesting if they are not equal.\n\n> # Create text containing 'line' without whitespace\n> $ echo 'line' > text\n> $ git add text\n> $ git commit -m \"first\" text\n>\n> # Here, I add one space of indentation in front of 'line'\n> $ echo ' line' > text\n> $ git commit -m \"second\" text\n\nSo \"line\" wasn't actually changed. It just happens to be on a line which\n_did_ change.\n\n> I would like to see both \"first\" and \"second\" somehow - can I do that?\n\nI don't think there's an easy way to do this right now; you would need\nto do \"git log -p\" and search through the output to get what you want (I\noften do this just using the pager's search function).\n\n-Peff\n"},{"id":"106853","messageId":"20090303154041.GA31265@coredump.intra.peff.net","threadId":"18110","inReplyTo":"20090303152333.GB24593@coredump.intra.peff.net","subject":"[PATCH] doc: clarify how -S works","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-03T15:40:41Z","receivedAt":"2009-03-03T15:40:41Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The existing text was very vague about what exactly it means\nfor difference to \"contain\" a change. This seems to cause\nconfusion on the mailing list every month or two.\n\nTo fix it we:\n\n  1. use \"introduce or remove an instance of\" instead of\n     \"contain\"\n\n  2. point the user to gitdiffcore(7), which contains a more\n     complete explanation\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI wonder if \"gitdiffcore\" is a little scary for new people who just want\nto use \"-S\", but hopefully point (1) above will get rid of most of the\nconfusion, and those who follow the link want to learn all about diff.\n\n Documentation/diff-options.txt |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\ndiff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\nindex 813a7b1..9276fae 100644\n--- a/Documentation/diff-options.txt\n+++ b/Documentation/diff-options.txt\n@@ -176,7 +176,10 @@ override configuration settings.\n \tnumber.\n \n -S<string>::\n-\tLook for differences that contain the change in <string>.\n+\tLook for differences that introduce or remove an instance of\n+\t<string>. Note that this is different than the string simply\n+\tappearing in diff output; see the 'pickaxe' entry in\n+\tlinkgit:gitdiffcore[7] for more details.\n \n --pickaxe-all::\n \tWhen -S finds a change, show all the changes in that\n-- \n1.6.2.rc2.330.gba39e\n"},{"id":"106856","messageId":"49AD5164.8090507@sneakemail.com","threadId":"18110","inReplyTo":"20090303152333.GB24593@coredump.intra.peff.net","subject":"Re: git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Peter Valdemar Mørch (Lists)","fromEmail":"4ux6as402@sneakemail.com","sentAt":"2009-03-03T15:48:52Z","receivedAt":"2009-03-03T15:48:52Z","isPatch":false,"sender":{"key":"4ux6as402@sneakemail.com","avatar":null},"body":"How sad... From \"git log -Sfoo\" looking like a really cool feature, it \nnow for me goes into the \"must be plumbing because I have no use for it\" \nbin, as I can't rely on it:\n\nIf a commit removes mention of foo one place and just accidentally \nhappens to add foo somewhere completely unrelated then it wouldn't show \nup in the output.\n\nWould be neat with a feature that does what I thought -S did tho...\n\nThanks, Jeff, for both the answer and the documentation patch.\n\nPeter\n-- \nPeter Valdemar Mørch\nhttp://www.morch.com\n"},{"id":"106858","messageId":"7vprgyd2db.fsf@gitster.siamese.dyndns.org","threadId":"18110","inReplyTo":"49AD3E78.1050706@sneakemail.com","subject":"Re: git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-03T15:58:56Z","receivedAt":"2009-03-03T15:58:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Peter Valdemar Mørch (Lists)\"  <4ux6as402@sneakemail.com> writes:\n\n> Commits where only the indentation of 'foo' is changed are not shown\n> with \"git log -Sfoo\". Is there any way to force showing them along\n> with other changes involving foo? (E.g. for python, indentation\n> matters!)\n\nNo.  You should be running \"git log -p\" which spawns \"less\" and then type\n/foo to jump to the occurrences of \"foo\".\n\nThe pickaxe -Sfoo looks for a filepair that contains different number\nof substring \"foo\".  It was designed as a basic building block for a very\ndifferent kind of Porcelain, whose final shape would look like the tool\ndescribed in http://article.gmane.org/gmane.comp.version-control.git/217,\nbut not yet written by anybody yet.\n\nAnd I think it might be the good topic for a SoC project.  From some GUI,\nyou let the user grab a block of text, feed it to \"log -S<that multi-line\nstring> -1\" to find where that block of text last changed, and inspect the\ncommit you have found very carefully using things like \"git grep\" to find\nother places in the commit that could be related to the change of the\nblock of text, present all of them to the user.  From there you let the\nuser dig deeper in the history by choosing what to look for next, most\nlikely giving the default selection to the block of text that roughly\ncorresponds to the original selection.\n\nTo make the iteration fast for this use case, the pickaxe cannot afford to\nactually run diff and then grep inside the diff output (which is what you\nwould be doing with \"log -p | less\" and looking for your string in it).\n"},{"id":"106860","messageId":"49AD547E.7030703@drmicha.warpmail.net","threadId":"18110","inReplyTo":"20090303152333.GB24593@coredump.intra.peff.net","subject":"Re: git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2009-03-03T16:02:06Z","receivedAt":"2009-03-03T16:02:06Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Jeff King venit, vidit, dixit 03.03.2009 16:23:\n> On Tue, Mar 03, 2009 at 03:28:08PM +0100, \"Peter Valdemar Mørch (Lists)\" wrote:\n> \n>> Commits where only the indentation of 'foo' is changed are not shown with \n>> \"git log -Sfoo\". Is there any way to force showing them along with other \n>> changes involving foo? (E.g. for python, indentation matters!)\n>>\n>> Why doesn't the second commit show up in the following?\n> \n> Because you misunderstand how \"-S\" works (but don't worry, it's not your\n> fault -- the documentation is somewhat misleading). The documentation says:\n> \n>   -S<string>\n>     Look for differences that contain the change in <string>.\n> \n> but what it actually does is find changes where the string was introduced\n> or removed. So it literally counts the number of occurences before and\n> after the commit, and the commit is interesting if they are not equal.\n\nHmm. The diffcore doc sounds more like if the filepair is picked if\n#before > 0 and #after = 0, but not if #after > 0.\n\nIn any case, the pickaxe can't detect moving around of strings, right?\n\n>> # Create text containing 'line' without whitespace\n>> $ echo 'line' > text\n>> $ git add text\n>> $ git commit -m \"first\" text\n>>\n>> # Here, I add one space of indentation in front of 'line'\n>> $ echo ' line' > text\n>> $ git commit -m \"second\" text\n> \n> So \"line\" wasn't actually changed. It just happens to be on a line which\n> _did_ change.\n> \n>> I would like to see both \"first\" and \"second\" somehow - can I do that?\n> \n> I don't think there's an easy way to do this right now; you would need\n> to do \"git log -p\" and search through the output to get what you want (I\n> often do this just using the pager's search function).\n\nIf you know what your are looking for you can do variations on\n\ngit log -S'line| line' --pickaxe-regex\n\nwhich seems to be different from\n\ngit log -S'line' -S' line'\n\nwhich was my first attempt...\n\nMichael\n"},{"id":"106863","messageId":"20090303160324.GA32079@coredump.intra.peff.net","threadId":"18110","inReplyTo":"49AD5164.8090507@sneakemail.com","subject":"Re: git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-03T16:03:24Z","receivedAt":"2009-03-03T16:03:24Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 03, 2009 at 04:48:52PM +0100, \"Peter Valdemar Mørch (Lists)\" wrote:\n\n> If a commit removes mention of foo one place and just accidentally  \n> happens to add foo somewhere completely unrelated then it wouldn't show  \n> up in the output.\n\nRight. But think for a minute about what it means to \"move\". If I have:\n\n  foo\n  bar\n\nand then change it to:\n\n  bar\n  foo\n\nDid \"foo\" move, or did \"bar\"?\n\nSo I'm not sure that what you're asking for is necessarily well-defined.\n\n> Would be neat with a feature that does what I thought -S did tho...\n\nYou can do:\n\n  git log -z -p | perl -0ne 'print if /^[-+].*string/m' | tr '\\0' '\\n'\n\nwhich I think is what you want (show any commit that has changed lines\nthat contain the string). But of course you will lose colorizing and\nautomatic paging, and it's a lot slower. And note that whether it finds\nthe example above will depend on how the diff is generated: did \"foo\"\nmove or did \"bar\"? But in practice it will generally find what you are\nlooking for.\n\n> Thanks, Jeff, for both the answer and the documentation patch.\n\nYou're welcome.\n\n-Peff\n"},{"id":"106865","messageId":"43d8ce650903030812n6fe857atb773f5068b6f0a17@mail.gmail.com","threadId":"18110","inReplyTo":"20090303154041.GA31265@coredump.intra.peff.net","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-03T16:12:30Z","receivedAt":"2009-03-03T16:12:30Z","isPatch":true,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/3 Jeff King <peff@peff.net>:\n> The existing text was very vague about what exactly it means\n> for difference to \"contain\" a change. This seems to cause\n> confusion on the mailing list every month or two.\n>\n> To fix it we:\n>\n>  1. use \"introduce or remove an instance of\" instead of\n>     \"contain\"\n\nI would read this to mean that it doesn't include modifying a line\ncontaining that string.  But I also know that underneath the hood, a\nchange is a remove then an addition, so I would be confused :)\n\nWhat about saying \"modifies\" rather than \"contain\" ?\n\n>\n>  2. point the user to gitdiffcore(7), which contains a more\n>     complete explanation\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> I wonder if \"gitdiffcore\" is a little scary for new people who just want\n> to use \"-S\", but hopefully point (1) above will get rid of most of the\n> confusion, and those who follow the link want to learn all about diff.\n>\n>  Documentation/diff-options.txt |    5 ++++-\n>  1 files changed, 4 insertions(+), 1 deletions(-)\n>\n> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\n> index 813a7b1..9276fae 100644\n> --- a/Documentation/diff-options.txt\n> +++ b/Documentation/diff-options.txt\n> @@ -176,7 +176,10 @@ override configuration settings.\n>        number.\n>\n>  -S<string>::\n> -       Look for differences that contain the change in <string>.\n> +       Look for differences that introduce or remove an instance of\n> +       <string>. Note that this is different than the string simply\n> +       appearing in diff output; see the 'pickaxe' entry in\n> +       linkgit:gitdiffcore[7] for more details.\n>\n>  --pickaxe-all::\n>        When -S finds a change, show all the changes in that\n> --\n> 1.6.2.rc2.330.gba39e\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n>\n"},{"id":"106868","messageId":"20090303161934.GD32079@coredump.intra.peff.net","threadId":"18110","inReplyTo":"43d8ce650903030812n6fe857atb773f5068b6f0a17@mail.gmail.com","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-03T16:19:34Z","receivedAt":"2009-03-03T16:19:34Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 03, 2009 at 04:12:30PM +0000, John Tapsell wrote:\n\n> > To fix it we:\n> >\n> >  1. use \"introduce or remove an instance of\" instead of\n> >     \"contain\"\n> \n> I would read this to mean that it doesn't include modifying a line\n> containing that string.  But I also know that underneath the hood, a\n> change is a remove then an addition, so I would be confused :)\n> \n> What about saying \"modifies\" rather than \"contain\" ?\n\nI'm confused. It _doesn't_ include modifying a line containing the\nstring. In which case it has done its job. But your \"but\" after that\nis what leaves me confused. You thought it would mean that, but you\ndon't due to some other knowledge, which is leading you down the wrong\npath?\n\nI was trying to get away with a short and sweet description. But the\nbehavior is basically (with a few optimizations):\n\n  if count(a, string) != count(b, string) then\n    it is interesting\n\nwhich is unambiguous, but it takes a second to realize the implications.\n\n-Peff\n"},{"id":"106869","messageId":"7vhc2ad1b1.fsf@gitster.siamese.dyndns.org","threadId":"18110","inReplyTo":"49AD5164.8090507@sneakemail.com","subject":"Re: git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-03T16:21:54Z","receivedAt":"2009-03-03T16:21:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Peter Valdemar Mørch (Lists)\"  <4ux6as402@sneakemail.com> writes:\n\n> How sad... From \"git log -Sfoo\" looking like a really cool feature,\n\nIt is a cool feature, but its coolness lies in the other parts of a\nPorcelain that is still to be written.  See my other message.\n"},{"id":"106870","messageId":"43d8ce650903030822t21517c6fxd003d4cbef6524f2@mail.gmail.com","threadId":"18110","inReplyTo":"20090303161934.GD32079@coredump.intra.peff.net","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-03T16:22:37Z","receivedAt":"2009-03-03T16:22:37Z","isPatch":true,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/3 Jeff King <peff@peff.net>:\n> On Tue, Mar 03, 2009 at 04:12:30PM +0000, John Tapsell wrote:\n>\n>> > To fix it we:\n>> >\n>> >  1. use \"introduce or remove an instance of\" instead of\n>> >     \"contain\"\n>>\n>> I would read this to mean that it doesn't include modifying a line\n>> containing that string.  But I also know that underneath the hood, a\n>> change is a remove then an addition, so I would be confused :)\n>>\n>> What about saying \"modifies\" rather than \"contain\" ?\n>\n> I'm confused. It _doesn't_ include modifying a line containing the\n> string. In which case it has done its job. But your \"but\" after that\n> is what leaves me confused. You thought it would mean that, but you\n> don't due to some other knowledge, which is leading you down the wrong\n> path?\n\nYes, it would seem that I was also confused as to what -S means.  It\ndoesn't mean what I thought it meant :-)\n\n> I was trying to get away with a short and sweet description. But the\n> behavior is basically (with a few optimizations):\n>\n>  if count(a, string) != count(b, string) then\n>    it is interesting\n>\n> which is unambiguous, but it takes a second to realize the implications.\n>\n> -Peff\n>\n"},{"id":"106872","messageId":"20090303162519.GE32079@coredump.intra.peff.net","threadId":"18110","inReplyTo":"49AD547E.7030703@drmicha.warpmail.net","subject":"Re: git log -Sfoo ignores indentation (whitespace?) changes...","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-03T16:25:19Z","receivedAt":"2009-03-03T16:25:19Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 03, 2009 at 05:02:06PM +0100, Michael J Gruber wrote:\n\n> > but what it actually does is find changes where the string was introduced\n> > or removed. So it literally counts the number of occurences before and\n> > after the commit, and the commit is interesting if they are not equal.\n> \n> Hmm. The diffcore doc sounds more like if the filepair is picked if\n> #before > 0 and #after = 0, but not if #after > 0.\n\nNope, the code is #before != #after. There are some special cases around\ndeleted and unmerged files, but the obvious one is:\n\n    $ sed -n 89,92p diffcore-pickaxe.c\n                    else if (!diff_unmodified_pair(p) &&\n                             contains(p->one, needle, len, regexp) !=\n                             contains(p->two, needle, len, regexp))\n                            has_changes++;\n\nSo maybe the diffcore documentation needs to be clarified.\n\n> In any case, the pickaxe can't detect moving around of strings, right?\n\nNo, it won't (and see my other mail elsewhere in the thread for why that is\nactually hard to define).\n\n-Peff\n"},{"id":"106877","messageId":"7v1vted0d7.fsf@gitster.siamese.dyndns.org","threadId":"18110","inReplyTo":"20090303154041.GA31265@coredump.intra.peff.net","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-03T16:42:12Z","receivedAt":"2009-03-03T16:42:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I wonder if \"gitdiffcore\" is a little scary for new people who just want\n> to use \"-S\", but hopefully point (1) above will get rid of most of the\n> confusion, and those who follow the link want to learn all about diff.\n\nAs I mentioned in the other message, what --pickaxe achieves is very\ndifferent from what people would naturally want from --search, an\noption that does not exist.\n\nI do not mind a patch that adds a diffcore transformation that internally\ngenerates a diff and searches the string given by the user in it, and\ntriggers that with --search option.  The transformation should come just\nafter (or before) the pickaxe in the call sequence inside diffcore_std();\nname it diffcore_search() or something.\n\nIn retrospect, because --pickaxe was designed primarily for Porcelain use,\nit was a mistake for it to have taken a short-and-sweet -S synonym.\n\n> diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt\n> index 813a7b1..9276fae 100644\n> --- a/Documentation/diff-options.txt\n> +++ b/Documentation/diff-options.txt\n> @@ -176,7 +176,10 @@ override configuration settings.\n>  \tnumber.\n>  \n>  -S<string>::\n> -\tLook for differences that contain the change in <string>.\n> +\tLook for differences that introduce or remove an instance of\n> +\t<string>. Note that this is different than the string simply\n> +\tappearing in diff output; see the 'pickaxe' entry in\n> +\tlinkgit:gitdiffcore[7] for more details.\n\nLook for differences that change the number of occurrences of <string>?\n"},{"id":"106885","messageId":"20090303171138.GA454@coredump.intra.peff.net","threadId":"18110","inReplyTo":"7v1vted0d7.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-03T17:11:38Z","receivedAt":"2009-03-03T17:11:38Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 03, 2009 at 08:42:12AM -0800, Junio C Hamano wrote:\n\n> In retrospect, because --pickaxe was designed primarily for Porcelain use,\n> it was a mistake for it to have taken a short-and-sweet -S synonym.\n\nHmm. I actually like the pickaxe behavior and find it useful for\nsearching. IOW, I consider it a porcelain feature, just perhaps not the\none that some people are expecting.\n\n> >  -S<string>::\n> > -\tLook for differences that contain the change in <string>.\n> > +\tLook for differences that introduce or remove an instance of\n> > +\t<string>. Note that this is different than the string simply\n> > +\tappearing in diff output; see the 'pickaxe' entry in\n> > +\tlinkgit:gitdiffcore[7] for more details.\n> \n> Look for differences that change the number of occurrences of <string>?\n\nYes, that is technically correct. I was trying to find a wording that\nwas a little less \"this is literally what it does\" and more \"this is\nwhat you might find it useful for\".\n\nBut I don't care overly much; I just think what was there was quite\nmisleading. And I've already provided my paint color, so feel free to\napply mine, use what you wrote above, or whatever. Just don't leave it\nas-is. ;)\n\n-Peff\n"},{"id":"106896","messageId":"43d8ce650903030939u73f09171uf4041b6d9824b698@mail.gmail.com","threadId":"18110","inReplyTo":"20090303171138.GA454@coredump.intra.peff.net","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"John Tapsell","fromEmail":"johnflux@gmail.com","sentAt":"2009-03-03T17:39:38Z","receivedAt":"2009-03-03T17:39:38Z","isPatch":true,"sender":{"key":"johnflux@gmail.com","avatar":"https://gravatar.com/avatar/25f70d4c0f96396b84a2e34bcd9bdc233462c7b4be29b5fdca8266fc53f30b0c?d=mp&s=160"},"body":"2009/3/3 Jeff King <peff@peff.net>:\n> On Tue, Mar 03, 2009 at 08:42:12AM -0800, Junio C Hamano wrote:\n>\n>> In retrospect, because --pickaxe was designed primarily for Porcelain use,\n>> it was a mistake for it to have taken a short-and-sweet -S synonym.\n>\n> Hmm. I actually like the pickaxe behavior and find it useful for\n> searching. IOW, I consider it a porcelain feature, just perhaps not the\n> one that some people are expecting.\n>\n>> >  -S<string>::\n>> > -   Look for differences that contain the change in <string>.\n>> > +   Look for differences that introduce or remove an instance of\n>> > +   <string>. Note that this is different than the string simply\n>> > +   appearing in diff output; see the 'pickaxe' entry in\n>> > +   linkgit:gitdiffcore[7] for more details.\n>>\n>> Look for differences that change the number of occurrences of <string>?\n>\n> Yes, that is technically correct. I was trying to find a wording that\n> was a little less \"this is literally what it does\" and more \"this is\n> what you might find it useful for\".\n\nIs there any way to have an option to also match any line containing\nthe string?  That might be the best way to document it, as well as\nbeing very useful:\n\n-s<string>\n   Look for any additions, removals or changes in any line containing <string>\n-S<string>\n   Look only for any additions or removals of the <string> in any line\n\nJohn\n"},{"id":"106900","messageId":"20090303175719.GC1636@coredump.intra.peff.net","threadId":"18110","inReplyTo":"43d8ce650903030939u73f09171uf4041b6d9824b698@mail.gmail.com","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-03-03T17:57:19Z","receivedAt":"2009-03-03T17:57:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Mar 03, 2009 at 05:39:38PM +0000, John Tapsell wrote:\n\n> > Yes, that is technically correct. I was trying to find a wording that\n> > was a little less \"this is literally what it does\" and more \"this is\n> > what you might find it useful for\".\n> \n> Is there any way to have an option to also match any line containing\n> the string?  That might be the best way to document it, as well as\n> being very useful:\n> \n> -s<string>\n>    Look for any additions, removals or changes in any line containing <string>\n> -S<string>\n>    Look only for any additions or removals of the <string> in any line\n\nYes, that would be possible (though it is still not foolproof against\nmoves, as I mentioned elsewhere), and I think it would be simple to\nexplain the two together.  It just needs somebody to code it.\n\nUnfortunately \"-s\" is already taken for \"no output\".\n\n-Peff\n"},{"id":"106904","messageId":"7veixebh2b.fsf@gitster.siamese.dyndns.org","threadId":"18110","inReplyTo":"43d8ce650903030939u73f09171uf4041b6d9824b698@mail.gmail.com","subject":"Re: [PATCH] doc: clarify how -S works","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-03-03T18:24:28Z","receivedAt":"2009-03-03T18:24:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"John Tapsell <johnflux@gmail.com> writes:\n\n> 2009/3/3 Jeff King <peff@peff.net>:\n>> On Tue, Mar 03, 2009 at 08:42:12AM -0800, Junio C Hamano wrote:\n>>\n>>> In retrospect, because --pickaxe was designed primarily for Porcelain use,\n>>> it was a mistake for it to have taken a short-and-sweet -S synonym.\n>>\n>> Hmm. I actually like the pickaxe behavior and find it useful for\n>> searching. IOW, I consider it a porcelain feature, just perhaps not the\n>> one that some people are expecting.\n>>\n>>> >  -S<string>::\n>>> > -   Look for differences that contain the change in <string>.\n>>> > +   Look for differences that introduce or remove an instance of\n>>> > +   <string>. Note that this is different than the string simply\n>>> > +   appearing in diff output; see the 'pickaxe' entry in\n>>> > +   linkgit:gitdiffcore[7] for more details.\n>>>\n>>> Look for differences that change the number of occurrences of <string>?\n>>\n>> Yes, that is technically correct. I was trying to find a wording that\n>> was a little less \"this is literally what it does\" and more \"this is\n>> what you might find it useful for\".\n>\n> Is there any way to have an option to also match any line containing\n> the string?\n\nPatches welcome. I've already outlined what you need to do.\n\nI think it can be called -G (short for --grep-diff), if --search cannot be\nused because \"-s\" is unavailable.\n"}]}