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

Not-quite-a-bug in pickaxe

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 24, 2008, 11:43 UTC
Message-ID
<alpine.DEB.1.00.0811241238450.30769@pacific.mpi-cbg.de>
Hi people,

I do not know if I hit that behavior before, but now it hit me big time: if a commit moves a certain string from one place to another, "git log -S<string>" does not pick up that commit. The code responsible for this is in diffcore-pickaxe.c:

                        else if (!diff_unmodified_pair(p) &&
                                 contains(p->one, needle, len, regexp) !=
                                 contains(p->two, needle, len, regexp))
                                has_changes++;

Basically, the "contains()" method says how often the needle was found, and pickaxe just assumes that a move of a string is not interesting enough.

Now, this behavior is probably intended, as searching files is much cheaper than generating the diffs between them, yet it is something you'll have to keep in mind when using "-S".

Ciao, Dscho

Next: Mikael Magnusson
Message 1 of 3 in “Not-quite-a-bug in pickaxe”
  1. Johannes SchindelinNov 24, 2008
  2. Mikael MagnussonNov 24, 2008
  3. Johannes SchindelinNov 24, 2008

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.