From: Junio C Hamano Date: Sat, 19 Dec 2020 05:16:03 GMT Subject: Re: [BUG] Regression in 'git mergetool --tool-help' Message-ID: In-Reply-To: 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)