git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* --find-copies-harder finds fewer copies/renames than -C does
@ 2011-01-05 17:46 Stefan Haller
  2011-01-05 18:59 ` Junio C Hamano
  0 siblings, 1 reply; 9+ messages in thread
From: Stefan Haller @ 2011-01-05 17:46 UTC (permalink / raw)
  To: git

I was surprised to find out that --find-copies-harder can, under certain
circumstances, detect fewer renames than -C does for a given commit.
After some digging I think I understand now why this is so, but I find
it extremely unintuitive, and would like to know what other people think
about it.  I had expected --find-copies-harder to always detect at least
as many copies/renames as -C, and possibly more, but never less.

The case I had is this: I have a repo with about 10.000 files, and a
commit with 14 files being moved to a different folder; half of them
where unmodified moves, the other half had one-line modifications
(similarity index 97% or so).

"git show -C --name-status <commit>" detects all 14 files as renames;
"git show --find-copies-harder --name-status <commit>" only shows the
unmodified moves as renames, the ones with modifications are shown as
delete plus add.

The reason for this seems to be the condition
"num_create * num_src > rename_limit * rename_limit" in diffcore_rename;
--find-copies-harder exeeds the limit, so it turns off inexact rename
dectection *completely*, while -C stays well below the limit.

I had expected --find-copies-harder to still do inexact rename detection
among the changed files in the commit in this case, and turn it off only
for the unmodified files; I'm not familiar enough with the code to tell
whether that would be easy to implement though.

Any thoughts?


-- 
Stefan Haller
Berlin, Germany
http://www.haller-berlin.de/

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-01-06 22:29 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 17:46 --find-copies-harder finds fewer copies/renames than -C does Stefan Haller
2011-01-05 18:59 ` Junio C Hamano
2011-01-06 16:54   ` Stefan Haller
2011-01-06 20:42     ` Junio C Hamano
2011-01-06 21:50       ` [PATCH 0/3] Falling back "diff -C -C" to "diff -C" more gracefully Junio C Hamano
2011-01-06 21:50         ` [PATCH 1/3] diffcore-rename: refactor "too many candidates" logic Junio C Hamano
2011-01-06 21:50         ` [PATCH 2/3] diffcore-rename: record filepair for rename src Junio C Hamano
2011-01-06 21:50         ` [PATCH 3/3] diffcore-rename: fall back to -C when -C -C busts the rename limit Junio C Hamano
2011-01-06 22:28         ` [PATCH 0/3] Falling back "diff -C -C" to "diff -C" more gracefully Jeff King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).