]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'pw/diff-color-moved-fix'
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Jan 2022 22:01:29 +0000 (14:01 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 5 Jan 2022 22:01:29 +0000 (14:01 -0800)
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

1  2 
diff.c
t/t4015-diff-whitespace.sh

diff --cc diff.c
index 410768574280f1179c78724ae13387f351cbf4cd,c28c56c1283778a9cbaa32b4d7d43dd531b818fe..0b4f9b52c58eb156f2b076dbb0e1163ec6db6df3
--- 1/diff.c
--- 2/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;
Simple merge