Merge branch 'jk/add-i-diff-compact-heuristics' into maint

"git add -i/-p" learned to honor diff.compactionHeuristic
experimental knob, so that the user can work on the same hunk split
as "git diff" output.

* jk/add-i-diff-compact-heuristics:
  add--interactive: respect diff.compactionHeuristic
This commit is contained in:
Junio C Hamano 2016-07-11 10:44:09 -07:00
commit 52debb6831

View file

@ -45,6 +45,7 @@
my $normal_color = $repo->get_color("", "reset"); my $normal_color = $repo->get_color("", "reset");
my $diff_algorithm = $repo->config('diff.algorithm'); my $diff_algorithm = $repo->config('diff.algorithm');
my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic');
my $diff_filter = $repo->config('interactive.difffilter'); my $diff_filter = $repo->config('interactive.difffilter');
my $use_readkey = 0; my $use_readkey = 0;
@ -749,6 +750,9 @@ sub parse_diff {
if (defined $diff_algorithm) { if (defined $diff_algorithm) {
splice @diff_cmd, 1, 0, "--diff-algorithm=${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) { if (defined $patch_mode_revision) {
push @diff_cmd, get_diff_reference($patch_mode_revision); push @diff_cmd, get_diff_reference($patch_mode_revision);
} }