Skip to content

Commit

Permalink
Merge branch 'pb/mergetool-tool-help-fix' into seen
Browse files Browse the repository at this point in the history
Fix 2.29 regression where "git mergetool --tool-help" fails to list
all the available tools.

* pb/mergetool-tool-help-fix:
  mergetool--lib: fix '--tool-help' to correctly show available tools
  • Loading branch information
gitster committed Jan 8, 2021
2 parents 3bc74e7 + 80f5a16 commit a34cea0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
6 changes: 4 additions & 2 deletions git-mergetool--lib.sh
Expand Up @@ -46,9 +46,11 @@ show_tool_names () {
while read scriptname
do
setup_tool "$scriptname" 2>/dev/null
variants="$variants$(list_tool_variants)\n"
# We need an actual line feed here
variants="$variants
$(list_tool_variants)"
done
variants="$(echo "$variants" | sort | uniq)"
variants="$(echo "$variants" | sort -u)"

for toolname in $variants
do
Expand Down
11 changes: 11 additions & 0 deletions t/t7610-mergetool.sh
Expand Up @@ -831,4 +831,15 @@ test_expect_success 'mergetool -Oorder-file is honored' '
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_done

0 comments on commit a34cea0

Please sign in to comment.