]> source.dussan.org Git - jgit.git/commit
Break dissimilar file pairs during diff 70/1170/7
authorJeff Schumacher <jeffschu@google.com>
Thu, 22 Jul 2010 19:55:28 +0000 (12:55 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Wed, 28 Jul 2010 01:13:32 +0000 (18:13 -0700)
commit396fe6da4593645e1b9bada4fe314f6169ab2d17
tree7c465cc05f2fec78b2ab3cf29e8ea04831ba0b7c
parentf56a459966c8e5564cb23ccb3c272a0daa05a1aa
Break dissimilar file pairs during diff

File pairs that are very dissimilar during a diff were not being
broken apart into their constituent ADD/DELETE pairs. The leads to
sub-optimal rename detection. Take, for example, this situation:

A file exists at src/a.txt containing "foo". A user renames src/a.txt
to src/b.txt, then adds a new src/a.txt containing "bar".

Even though the old a.txt and the new b.txt are identical, the
rename detection algorithm would not detect it as a rename since
it was already paired in a MODIFY. I added code to split all
MODIFYs below a certain score into their constituent ADD/DELETE
pairs. This allows situations like the one I described above to be
more correctly handled.

Change-Id: I22c04b70581f206bbc68c4cd1ee87a1f663b418e
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/diff/RenameDetectorTest.java
org.eclipse.jgit/resources/org/eclipse/jgit/JGitText.properties
org.eclipse.jgit/src/org/eclipse/jgit/JGitText.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffEntry.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/DiffFormatter.java
org.eclipse.jgit/src/org/eclipse/jgit/diff/RenameDetector.java