summaryrefslogtreecommitdiff
path: root/git-add--interactive.perl
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-26 23:09:16 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-26 23:09:16 (GMT)
commitb7af6ae5cff8439fdf5b72f926cab2e614906af3 (patch)
treebc9721ce62fa88e4c2824e04069380d40e09d2d9 /git-add--interactive.perl
parentb3e588a48af0ce15832c240887b9a3f9361d22bb (diff)
parent5b162879e93dab3b4bcd66afdbea3a96660abd7d (diff)
downloadgit-b7af6ae5cff8439fdf5b72f926cab2e614906af3.zip
git-b7af6ae5cff8439fdf5b72f926cab2e614906af3.tar.gz
git-b7af6ae5cff8439fdf5b72f926cab2e614906af3.tar.bz2
Merge branch 'mh/diff-indent-heuristic'
Output from "git diff" can be made easier to read by selecting which lines are common and which lines are added/deleted intelligently when the lines before and after the changed section are the same. A command line option is added to help with the experiment to find a good heuristics. * mh/diff-indent-heuristic: blame: honor the diff heuristic options and config parse-options: add parse_opt_unknown_cb() diff: improve positioning of add/delete blocks in diffs xdl_change_compact(): introduce the concept of a change group recs_match(): take two xrecord_t pointers as arguments is_blank_line(): take a single xrecord_t as argument xdl_change_compact(): only use heuristic if group can't be matched xdl_change_compact(): fix compaction heuristic to adjust ixo
Diffstat (limited to 'git-add--interactive.perl')
-rwxr-xr-xgit-add--interactive.perl5
1 files changed, 4 insertions, 1 deletions
diff --git a/git-add--interactive.perl b/git-add--interactive.perl
index 642cce1..ee3d812 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_indent_heuristic = $repo->config_bool('diff.indentheuristic');
my $diff_compaction_heuristic = $repo->config_bool('diff.compactionheuristic');
my $diff_filter = $repo->config('interactive.difffilter');
@@ -750,7 +751,9 @@ sub parse_diff {
if (defined $diff_algorithm) {
splice @diff_cmd, 1, 0, "--diff-algorithm=${diff_algorithm}";
}
- if ($diff_compaction_heuristic) {
+ 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) {