summaryrefslogtreecommitdiff
path: root/t/chainlint/inline-comment.test
diff options
context:
space:
mode:
authorLibravatar Barret Rhoden <brho@google.com>2019-06-20 12:38:19 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2019-06-20 13:38:09 -0700
commita07a97760cbf2e794600157a5a9f61a888a17941 (patch)
treeac22afcf779b28ef3456abd55a42656c37cd073f /t/chainlint/inline-comment.test
parentblame: add a fingerprint heuristic to match ignored lines (diff)
downloadtgif-a07a97760cbf2e794600157a5a9f61a888a17941.tar.xz
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/chainlint/inline-comment.test')
0 files changed, 0 insertions, 0 deletions