diff: disable compaction heuristic for now

http://lkml.kernel.org/g/20160610075043.GA13411@sigill.intra.peff.net reports that a change to add a new "function" with common ending with the existing one at the end of the file is shown like this: def foo do_foo_stuff() + common_ending() +end + +def bar + do_bar_stuff() + common_ending() end when the new heuristic is in use. In reality, the change is to add the blank line before "def bar" and everything below, which is what the code without the new heuristic shows. Disable the heuristics by default, and resurrect the documentation for the option and the configuration variables, while clearly marking the feature as still experimental. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jun 10, 2016 at 10:58 UTC 5580b271af518bae30148edfd42cc8459d8da384
3 files changed +13 -1
Documentation/diff-config.txt
+5
@@ -166,6 +166,11 @@ diff.tool::
166
167 include::mergetools-diff.txt[]
168
169 +diff.compactionHeuristic::
170 + Set this option to `true` to enable an experimental heuristic that
171 + shifts the hunk boundary in an attempt to make the resulting
172 + patch easier to read.
173 +
174 diff.algorithm::
175 Choose a diff algorithm. The variants are as follows:
176 +
Documentation/diff-options.txt
+7
@@ -63,6 +63,13 @@ ifndef::git-format-patch[]
63 Synonym for `-p --raw`.
64 endif::git-format-patch[]
65
66 +--compaction-heuristic::
67 +--no-compaction-heuristic::
68 + These are to help debugging and tuning an experimental
69 + heuristic (which is off by default) that shifts the hunk
70 + boundary in an attempt to make the resulting patch easier
71 + to read.
72 +
73 --minimal::
74 Spend extra time to make sure the smallest possible
75 diff is produced.
diff.c
+1 -1
@@ -25,7 +25,7 @@
25 #endif
26
27 static int diff_detect_rename_default;
28 -static int diff_compaction_heuristic = 1;
28 +static int diff_compaction_heuristic; /* experimental */
29 static int diff_rename_limit_default = 400;
30 static int diff_suppress_blank_empty;
31 static int diff_use_color_default = -1;