]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'sh/mergetool-hideresolved'
authorJunio C Hamano <gitster@pobox.com>
Thu, 18 Feb 2021 01:21:41 +0000 (17:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Feb 2021 01:21:41 +0000 (17:21 -0800)
"git mergetool" feeds three versions (base, local and remote) of
a conflicted path unmodified.  The command learned to optionally
prepare these files with unconflicted parts already resolved.

* sh/mergetool-hideresolved:
  mergetool: add per-tool support and overrides for the hideResolved flag
  mergetool: break setup_tool out into separate initialization function
  mergetool: add hideResolved configuration

1  2 
git-mergetool--lib.sh
t/t7610-mergetool.sh

Simple merge
index 04b0095072d2ce1b347d1cd48e81d0be5c182dc2,0e34b87e376accbd613d96645f368fb5300c43e3..8cc64729adb20640f17de4aa9ba891a9ead7edde
@@@ -831,15 -828,22 +831,33 @@@ test_expect_success 'mergetool -Oorder-
        test_cmp expect actual
  '
  
 -      git checkout -b test${test_count}_b master &&
 +test_expect_success 'mergetool --tool-help shows recognized tools' '
 +      # Check a few known tools are correctly shown
 +      git mergetool --tool-help >mergetools &&
 +      grep vimdiff mergetools &&
 +      grep vimdiff3 mergetools &&
 +      grep gvimdiff2 mergetools &&
 +      grep araxis mergetools &&
 +      grep xxdiff mergetools &&
 +      grep meld mergetools
 +'
 +
+ test_expect_success 'mergetool hideResolved' '
+       test_config mergetool.hideResolved true &&
+       test_when_finished "git reset --hard" &&
++      git checkout -b test${test_count}_b main &&
+       test_write_lines >file1 base "" a &&
+       git commit -a -m "base" &&
+       test_write_lines >file1 base "" c &&
+       git commit -a -m "remote update" &&
+       git checkout -b test${test_count}_a HEAD~ &&
+       test_write_lines >file1 local "" b &&
+       git commit -a -m "local update" &&
+       test_must_fail git merge test${test_count}_b &&
+       yes "" | git mergetool file1 &&
+       test_write_lines >expect local "" c &&
+       test_cmp expect file1 &&
+       git commit -m "test resolved with mergetool"
+ '
  test_done