diff --git a/git-mergetool--lib.sh b/git-mergetool--lib.sh index 204a5acd66..29fecc340f 100644 --- a/git-mergetool--lib.sh +++ b/git-mergetool--lib.sh @@ -43,7 +43,14 @@ show_tool_names () { shown_any= ( cd "$MERGE_TOOLS_DIR" && ls ) | { - while read toolname + while read scriptname + do + setup_tool "$scriptname" 2>/dev/null + variants="$variants$(list_tool_variants)\n" Ahh, that does look quite bogus as \n won't do anything useful there. And I do not think we _need_ to use LF there. + done + variants="$(echo "$variants" | sort | uniq)" + + for toolname in $variants Just replace \n with " " (whitespace) and do something like this, perhaps? variants="$variantes$(list_tool_variants) " done variants=$(printf "%s\n" $variants | sort | uniq)