From: Junio C Hamano Date: Wed, 5 Jan 2022 22:01:29 +0000 (-0800) Subject: Merge branch 'pw/diff-color-moved-fix' X-Git-Tag: v2.35.0-rc0~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b755b337134aac9b1386e2d216cf734e1e229d2;p=thirdparty%2Fgit.git Merge branch 'pw/diff-color-moved-fix' Correctness and performance update to "diff --color-moved" feature. * pw/diff-color-moved-fix: diff --color-moved: intern strings diff: use designated initializers for emitted_diff_symbol diff --color-moved-ws=allow-indentation-change: improve hash lookups diff --color-moved: stop clearing potential moved blocks diff --color-moved: shrink potential moved blocks as we go diff --color-moved: unify moved block growth functions diff --color-moved: call comparison function directly diff --color-moved-ws=allow-indentation-change: simplify and optimize diff: simplify allow-indentation-change delta calculation diff --color-moved: avoid false short line matches and bad zebra coloring diff --color-moved=zebra: fix alternate coloring diff --color-moved: rewind when discarding pmb diff --color-moved: factor out function diff --color-moved: clear all flags on blocks that are too short diff --color-moved: add perf tests --- 2b755b337134aac9b1386e2d216cf734e1e229d2 diff --cc diff.c index 4107685742,c28c56c128..0b4f9b52c5 --- a/diff.c +++ b/diff.c @@@ -773,9 -773,10 +774,10 @@@ struct emitted_diff_symbol int flags; int indent_off; /* Offset to first non-whitespace character */ int indent_width; /* The visual width of the indentation */ + unsigned id; enum diff_symbol s; }; -#define EMITTED_DIFF_SYMBOL_INIT {NULL} +#define EMITTED_DIFF_SYMBOL_INIT { 0 } struct emitted_diff_symbols { struct emitted_diff_symbol *buf;