Skip to content

Commit 52debb6

Browse files
committed
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
2 parents 674d38f + 46e3d17 commit 52debb6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

git-add--interactive.perl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
my $normal_color = $repo->get_color("", "reset");
4646

4747
my $diff_algorithm = $repo->config('diff.algorithm');
48+
my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic');
4849
my $diff_filter = $repo->config('interactive.difffilter');
4950

5051
my $use_readkey = 0;
@@ -749,6 +750,9 @@ sub parse_diff {
749750
if (defined $diff_algorithm) {
750751
splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
751752
}
753+
if ($diff_compaction_heuristic) {
754+
splice @diff_cmd, 1, 0, "--compaction-heuristic";
755+
}
752756
if (defined $patch_mode_revision) {
753757
push @diff_cmd, get_diff_reference($patch_mode_revision);
754758
}

0 commit comments

Comments
 (0)