From: Junio C Hamano Date: Thu, 18 Feb 2021 01:21:41 +0000 (-0800) Subject: Merge branch 'sh/mergetool-hideresolved' X-Git-Tag: v2.31.0-rc0~40 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78a26cb7204ddb96a5f75f09e41fbefd81c85f59;p=thirdparty%2Fgit.git Merge branch 'sh/mergetool-hideresolved' "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 --- 78a26cb7204ddb96a5f75f09e41fbefd81c85f59 diff --cc t/t7610-mergetool.sh index 04b0095072,0e34b87e37..8cc64729ad --- a/t/t7610-mergetool.sh +++ b/t/t7610-mergetool.sh @@@ -831,15 -828,22 +831,33 @@@ test_expect_success 'mergetool -Oorder- test_cmp expect actual ' +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 master && ++ 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