summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-12-23 20:32:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-12-23 20:32:22 (GMT)
commit3cde4e02ee891bff53bac7f6a7d977f50418a4b5 (patch)
treebe578af45d9afe9d9987e40ab6659fde29f9dcec /git-add--interactive.perl
parentbe5a750939c212bc0781ffa04fabcfd2b2bd744e (diff)
downloadgit-3cde4e02ee891bff53bac7f6a7d977f50418a4b5.zip
git-3cde4e02ee891bff53bac7f6a7d977f50418a4b5.tar.gz
git-3cde4e02ee891bff53bac7f6a7d977f50418a4b5.tar.bz2
diff: retire "compaction" heuristics
When a patch inserts a block of lines, whose last lines are the same as the existing lines that appear before the inserted block, "git diff" can choose any place between these existing lines as the boundary between the pre-context and the added lines (adjusting the end of the inserted block as appropriate) to come up with variants of the same patch, and some variants are easier to read than others. We have been trying to improve the choice of this boundary, and Git 2.11 shipped with an experimental "compaction-heuristic". Since then another attempt to improve the logic further resulted in a new "indent-heuristic" logic. It is agreed that the latter gives better result overall, and the former outlived its usefulness. Retire "compaction", and keep "indent" as an experimental feature. The latter hopefully will be turned on by default in a future release, but that should be done as a separate step. Suggested-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl3
1 files changed, 0 insertions, 3 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index ee3d812..5a55d80 100755
--- a/git-add--interactive.perl
+++ b/git-add--interactive.perl
@@ -46,7 +46,6 @@ my $normal_color = $repo->get_color("", "reset");
my $diff_algorithm = $repo->config('diff.algorithm');
my $diff_indent_heuristic = $repo->config_bool('diff.indentheuristic');
-my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic');
my $diff_filter = $repo->config('interactive.difffilter');
my $use_readkey = 0;
@@ -753,8 +752,6 @@ sub parse_diff {
}
if ($diff_indent_heuristic) {
splice @diff_cmd, 1, 0, "--indent-heuristic";
- } elsif ($diff_compaction_heuristic) {
- splice @diff_cmd, 1, 0, "--compaction-heuristic";
}
if (defined $patch_mode_revision) {
push @diff_cmd, get_diff_reference($patch_mode_revision);