git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git log -Sfoo ignores indentation (whitespace?) changes...

From
Jeff King <peff@peff.net>
Date
Mar 3, 2009, 16:25 UTC
Message-ID
<20090303162519.GE32079@coredump.intra.peff.net>
In-Reply-To
<49AD547E.7030703@drmicha.warpmail.net>
On Tue, Mar 03, 2009 at 05:02:06PM +0100, Michael J Gruber wrote:
Show 6 quoted lines
> > but what it actually does is find changes where the string was introduced
> > or removed. So it literally counts the number of occurences before and
> > after the commit, and the commit is interesting if they are not equal.
> 
> Hmm. The diffcore doc sounds more like if the filepair is picked if
> #before > 0 and #after = 0, but not if #after > 0.

Nope, the code is #before != #after. There are some special cases around deleted and unmerged files, but the obvious one is:

    $ sed -n 89,92p diffcore-pickaxe.c
                    else if (!diff_unmodified_pair(p) &&
                             contains(p->one, needle, len, regexp) !=
                             contains(p->two, needle, len, regexp))
                            has_changes++;
So maybe the diffcore documentation needs to be clarified.
> In any case, the pickaxe can't detect moving around of strings, right?

No, it won't (and see my other mail elsewhere in the thread for why that is actually hard to define).

-Peff
Previous: Michael J GruberNext: Junio C Hamano
Message 16 of 17 in “git log -Sfoo ignores indentation (whitespace?) changes...”
  1. Peter Valdemar Mørch (Lists)Mar 3, 2009
  2. Jeff KingMar 3, 2009
  3. doc: clarify how -S worksJeff King, Mar 3, 2009
  4. John TapsellMar 3, 2009
  5. Jeff KingMar 3, 2009
  6. John TapsellMar 3, 2009
  7. Junio C HamanoMar 3, 2009
  8. Jeff KingMar 3, 2009
  9. John TapsellMar 3, 2009
  10. Jeff KingMar 3, 2009
  11. Junio C HamanoMar 3, 2009
  12. Peter Valdemar Mørch (Lists)Mar 3, 2009
  13. Jeff KingMar 3, 2009
  14. Junio C HamanoMar 3, 2009
  15. Michael J GruberMar 3, 2009
  16. Jeff KingMar 3, 2009
  17. Junio C HamanoMar 3, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.