aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java
diff options
context:
space:
mode:
authorJeff Schumacher <jeffschu@google.com>2010-07-13 12:21:12 -0700
committerJeff Schumacher <jeffschu@google.com>2010-07-16 09:56:42 -0700
commit31311cacfd311f9a78bdf012a9f6ba1907b9964a (patch)
tree2f68c9b3af58ca0ffd1d96c05d49d8a64ebb2275 /org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java
parentf666cc755b35a8f57a7c208c88230f7ab7c1d07b (diff)
downloadjgit-31311cacfd311f9a78bdf012a9f6ba1907b9964a.tar.gz
jgit-31311cacfd311f9a78bdf012a9f6ba1907b9964a.zip
Implemented file path based tie breaking to exact rename detection
During the exact rename detection phase in RenameDetector, ties were resolved on a first-found basis. I added support for file path based tie breaking during that phase. Basically, there are four situations that have to be handled: One add matching one delete: In this simple case, we pair them as a rename. One add matching many deletes: Find the delete whos path matches the add the closest, and pair them as a rename. Many adds matching one delete: Similar to the above case, we find the add that matches the delete the closest, and pair them as a rename. The other adds are marked as copies of the delete. Many adds matching many deletes: Build a scoring matrix similar to the one used for content- based matching, scoring instead by file path. Some of the utility functions in SimilarityRenameDetector are used in this case, as we use the same encoding scheme. Once the matrix is built, scan it for the best matches, marking them as renames. The rest are marked as copies. I don't particularly like the idea of using utility functions right out of SimilarityRenameDetector, but it works for the moment. A later commit will likely refactor this into a common utility class, as well as bringing exact rename detection out of RenameDetector and into a separate class, much like SimilarityRenameDetector. Change-Id: I1fb08390aebdcbf20d049aecf402a36506e55611
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/patch/BinaryHunk.java')
0 files changed, 0 insertions, 0 deletions