Re: [BUG] Regression in 'git mergetool --tool-help'
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Dec 20, 2020, 15:34 UTC
- Message-ID
- <xmqq1rfko5j4.fsf@gitster.c.googlers.com>
- In-Reply-To
- <c4f2330f-715b-1745-5ad7-5477f4e833db@gmail.com>
Philippe Blain <levraiphilippeblain@gmail.com> writes:
> Thanks for both answers. Felipe's solution does the trick, but Junio's does not; > it seems we do have to have a newline there.
Curious. Are you sure you changed the second echo to printf and left the argument after '%s\n' unquoted, i.e. $variants and not "$variants"?
Show 10 quoted lines
> diff --git i/git-mergetool--lib.sh w/git-mergetool--lib.sh
> index 2defef28cd..6f03975493 100644
> --- i/git-mergetool--lib.sh
> +++ w/git-mergetool--lib.sh
> @@ -46,7 +46,7 @@ show_tool_names () {
> while read scriptname
> do
> setup_tool "$scriptname" 2>/dev/null
> - variants="$variants$(list_tool_variants)\n"
> + variants="$(echo "$variants" && list_tool_variants)"Gee, echoing the variable double-quoted inside $()? That's as ugly as a command substitution construct can go X-<.
> done > variants="$(echo "$variants" | sort | uniq)"