aboutsummaryrefslogtreecommitdiffstats
path: root/t/t8014-blame-ignore-fuzzy.sh
diff options
context:
space:
mode:
authorBarret Rhoden <brho@google.com>2019-06-20 12:38:19 -0400
committerJunio C Hamano <gitster@pobox.com>2019-06-20 13:38:09 -0700
commita07a97760cbf2e794600157a5a9f61a888a17941 (patch)
treeac22afcf779b28ef3456abd55a42656c37cd073f /t/t8014-blame-ignore-fuzzy.sh
parent1d028dc682d0cb4420fb124419ebc60e913d421c (diff)
downloadgit-a07a97760cbf2e794600157a5a9f61a888a17941.tar.gz
blame: use the fingerprint heuristic to match ignored lines
This commit integrates the fuzzy fingerprint heuristic into guess_line_blames(). We actually make two passes. The first pass uses the fuzzy algorithm to find a match within the current diff chunk. If that fails, the second pass searches the entire parent file for the best match. For an example of scanning the entire parent for a match, consider: commit-a 30) #include <sys/header_a.h> commit-b 31) #include <header_b.h> commit-c 32) #include <header_c.h> Then commit X alphabetizes them: commit-X 30) #include <header_b.h> commit-X 31) #include <header_c.h> commit-X 32) #include <sys/header_a.h> If we just check the parent's chunk (i.e. the first pass), we'd get: commit-b 30) #include <header_b.h> commit-c 31) #include <header_c.h> commit-X 32) #include <sys/header_a.h> That's because commit X actually consists of two chunks: one chunk is removing sys/header_a.h, then some context, and the second chunk is adding sys/header_a.h. If we scan the entire parent file, we get: commit-b 30) #include <header_b.h> commit-c 31) #include <header_c.h> commit-a 32) #include <sys/header_a.h> Signed-off-by: Barret Rhoden <brho@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t8014-blame-ignore-fuzzy.sh')
-rwxr-xr-xt/t8014-blame-ignore-fuzzy.sh3
1 files changed, 0 insertions, 3 deletions
diff --git a/t/t8014-blame-ignore-fuzzy.sh b/t/t8014-blame-ignore-fuzzy.sh
index 8443966152..6f1a94caef 100755
--- a/t/t8014-blame-ignore-fuzzy.sh
+++ b/t/t8014-blame-ignore-fuzzy.sh
@@ -3,9 +3,6 @@
test_description='git blame ignore fuzzy heuristic'
. ./test-lib.sh
-# short circuit until blame has the fuzzy capabilities
-test_done
-
pick_author='s/^[0-9a-f^]* *(\([^ ]*\) .*/\1/'
# Each test is composed of 4 variables: