* Not-quite-a-bug in pickaxe
@ 2008-11-24 11:43 Johannes Schindelin
2008-11-24 15:08 ` Mikael Magnusson
0 siblings, 1 reply; 3+ messages in thread
From: Johannes Schindelin @ 2008-11-24 11:43 UTC (permalink / raw)
To: git, gitster
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
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Not-quite-a-bug in pickaxe
2008-11-24 11:43 Not-quite-a-bug in pickaxe Johannes Schindelin
@ 2008-11-24 15:08 ` Mikael Magnusson
2008-11-24 17:36 ` Johannes Schindelin
0 siblings, 1 reply; 3+ messages in thread
From: Mikael Magnusson @ 2008-11-24 15:08 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git, gitster
2008/11/24 Johannes Schindelin <Johannes.Schindelin@gmx.de>:
> Hi people,
>
> I do not know if I hit that behavior before,
I'm pretty sure it has,
http://thread.gmane.org/gmane.comp.version-control.git/100113/focus=100115
(at least i think that's the same case?)
> 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".
--
Mikael Magnusson
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-11-24 17:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-24 11:43 Not-quite-a-bug in pickaxe Johannes Schindelin
2008-11-24 15:08 ` Mikael Magnusson
2008-11-24 17:36 ` Johannes Schindelin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox