diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2017-11-27 11:47:47 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-11-28 10:40:04 +0900 |
commit | 2477ab2ea8651920a9909f6d05b15ad9004a6c64 (patch) | |
tree | 50a1cc585b71420b1da0230451ef932b114f809b /Documentation/diff-options.txt | |
parent | 5f9953d2c365bffed6f9ee0c6966556bd4d7e2f4 (diff) | |
download | git-2477ab2ea8651920a9909f6d05b15ad9004a6c64.tar.gz |
diff: support anchoring line(s)jt/diff-anchored-patience
Teach diff a new algorithm, one that attempts to prevent user-specified
lines from appearing as a deletion or addition in the end result. The
end user can use this by specifying "--anchored=<text>" one or more
times when using Git commands like "diff" and "show".
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/diff-options.txt')
-rw-r--r-- | Documentation/diff-options.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 3c93c21683..9d1586b956 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -80,6 +80,16 @@ endif::git-format-patch[] --histogram:: Generate a diff using the "histogram diff" algorithm. +--anchored=<text>:: + Generate a diff using the "anchored diff" algorithm. ++ +This option may be specified more than once. ++ +If a line exists in both the source and destination, exists only once, +and starts with this text, this algorithm attempts to prevent it from +appearing as a deletion or addition in the output. It uses the "patience +diff" algorithm internally. + --diff-algorithm={patience|minimal|histogram|myers}:: Choose a diff algorithm. The variants are as follows: + |