summaryrefslogtreecommitdiff
path: root/xdiff/xdiff.h
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2009-01-07 18:04:09 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-07 13:35:44 -0800
commit92b7de93fb7801570ddc3195f03f30b9c201a3bd (patch)
treee7113b428c97f3e6b107f1d64c74f343eda7ecf9 /xdiff/xdiff.h
parent8104ebfe8276657ee803cca7eb8665a78cf3ef83 (diff)
downloadgit-92b7de93fb7801570ddc3195f03f30b9c201a3bd.tar.gz
Implement the patience diff algorithm
The patience diff algorithm produces slightly more intuitive output than the classic Myers algorithm, as it does not try to minimize the number of +/- lines first, but tries to preserve the lines that are unique. To this end, it first determines lines that are unique in both files, then the maximal sequence which preserves the order (relative to both files) is extracted. Starting from this initial set of common lines, the rest of the lines is handled recursively, with Myers' algorithm as a fallback when the patience algorithm fails (due to no common unique lines). This patch includes memory leak fixes by Pierre Habouzit. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'xdiff/xdiff.h')
-rw-r--r--xdiff/xdiff.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/xdiff/xdiff.h b/xdiff/xdiff.h
index 84fff583e2..d238c8263e 100644
--- a/xdiff/xdiff.h
+++ b/xdiff/xdiff.h
@@ -32,6 +32,7 @@ extern "C" {
#define XDF_IGNORE_WHITESPACE (1 << 2)
#define XDF_IGNORE_WHITESPACE_CHANGE (1 << 3)
#define XDF_IGNORE_WHITESPACE_AT_EOL (1 << 4)
+#define XDF_PATIENCE_DIFF (1 << 5)
#define XDF_WHITESPACE_FLAGS (XDF_IGNORE_WHITESPACE | XDF_IGNORE_WHITESPACE_CHANGE | XDF_IGNORE_WHITESPACE_AT_EOL)
#define XDL_PATCH_NORMAL '-'