diff options
author | Jeff King <peff@peff.net> | 2016-06-16 08:27:29 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-16 11:38:58 -0700 |
commit | 46e3d17f57f90538242b7a1dde126eba59f7c5ab (patch) | |
tree | 4ed00dbb1b0ae95feb43b0c9c1767545ba5364bc | |
parent | e5f767554404592cf65e7c49b3594b195a324031 (diff) | |
download | git-46e3d17f57f90538242b7a1dde126eba59f7c5ab.tar.gz |
add--interactive: respect diff.compactionHeuristicjk/add-i-diff-compact-heuristics
We use plumbing to generate the diff, so it doesn't
automatically pick up UI config like compactionHeuristic.
Let's forward it on, since interactive adding is porcelain.
Note that we only need to handle the "true" case. There's no
point in passing --no-compaction-heuristic when the variable
is false, since nothing else could have turned it on.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-x | git-add--interactive.perl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl index 822f857038..642cce1ac6 100755 --- a/git-add--interactive.perl +++ b/git-add--interactive.perl @@ -45,6 +45,7 @@ my ($diff_new_color) = my $normal_color = $repo->get_color("", "reset"); my $diff_algorithm = $repo->config('diff.algorithm'); +my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic'); my $diff_filter = $repo->config('interactive.difffilter'); my $use_readkey = 0; @@ -749,6 +750,9 @@ sub parse_diff { if (defined $diff_algorithm) { splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}"; } + if ($diff_compaction_heuristic) { + splice @diff_cmd, 1, 0, "--compaction-heuristic"; + } if (defined $patch_mode_revision) { push @diff_cmd, get_diff_reference($patch_mode_revision); } |