From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Jacob Keller <jacob.keller@gmail.com>,
Stefan Beller <sbeller@google.com>,
"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: [PATCH v2] diff: disable compaction heuristic for now
Date: Fri, 10 Jun 2016 13:48:58 -0700 [thread overview]
Message-ID: <xmqqoa78epmt.fsf_-_@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160610203026.GA21464@sigill.intra.peff.net> (Jeff King's message of "Fri, 10 Jun 2016 16:30:26 -0400")
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>
---
Jeff King <peff@peff.net> writes:
> We probably want a patch to the release notes to note that it's not on
> by default. And we may want to advertise the experimental knob so
> that people actually try it (otherwise we won't get feedback from the
> masses).
OK, I think that is sensible. The interdiff is not a strict
reversion of 77085a61 (diff: undocument the compaction heuristic
knobs for experimentation, 2016-05-02) but stresses that the
feature is off by default and is experimental.
Documentation/diff-config.txt | 5 +++++
Documentation/diff-options.txt | 7 +++++++
diff.c | 2 +-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/Documentation/diff-config.txt b/Documentation/diff-config.txt
index 6eaa452..6fb70c5 100644
--- a/Documentation/diff-config.txt
+++ b/Documentation/diff-config.txt
@@ -166,6 +166,11 @@ diff.tool::
include::mergetools-diff.txt[]
+diff.compactionHeuristic::
+ Set this option to `true` to enable an experimental heuristic that
+ shifts the hunk boundary in an attempt to make the resulting
+ patch easier to read.
+
diff.algorithm::
Choose a diff algorithm. The variants are as follows:
+
diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt
index 3ad6404..9baf1ad 100644
--- a/Documentation/diff-options.txt
+++ b/Documentation/diff-options.txt
@@ -63,6 +63,13 @@ ifndef::git-format-patch[]
Synonym for `-p --raw`.
endif::git-format-patch[]
+--compaction-heuristic::
+--no-compaction-heuristic::
+ These are to help debugging and tuning an experimental
+ heuristic (which is off by default) that shifts the hunk
+ boundary in an attempt to make the resulting patch easier
+ to read.
+
--minimal::
Spend extra time to make sure the smallest possible
diff is produced.
diff --git a/diff.c b/diff.c
index 05ca3ce..9116d9d 100644
--- a/diff.c
+++ b/diff.c
@@ -25,7 +25,7 @@
#endif
static int diff_detect_rename_default;
-static int diff_compaction_heuristic = 1;
+static int diff_compaction_heuristic; /* experimental */
static int diff_rename_limit_default = 400;
static int diff_suppress_blank_empty;
static int diff_use_color_default = -1;
--
2.9.0-rc2-285-ge226c12
next prev parent reply other threads:[~2016-06-10 20:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-10 7:50 [BUG-ish] diff compaction heuristic false positive Jeff King
2016-06-10 8:31 ` Jeff King
2016-06-10 15:56 ` Junio C Hamano
2016-06-10 16:25 ` Stefan Beller
2016-06-10 16:29 ` Jacob Keller
2016-06-10 18:13 ` Re* " Junio C Hamano
2016-06-10 18:21 ` Stefan Beller
2016-06-10 20:30 ` Jeff King
2016-06-10 20:48 ` Junio C Hamano [this message]
2016-06-10 20:53 ` [PATCH v2] diff: disable compaction heuristic for now Jeff King
2016-06-10 20:55 ` Junio C Hamano
2016-06-10 21:05 ` Jeff King
2016-06-10 21:46 ` Junio C Hamano
2016-06-10 8:31 ` [BUG-ish] diff compaction heuristic false positive Michael Haggerty
2016-06-10 8:41 ` Jeff King
2016-06-10 11:00 ` Michael Haggerty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqqoa78epmt.fsf_-_@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jacob.keller@gmail.com \
--cc=peff@peff.net \
--cc=sbeller@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.