git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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)"
Previous: Junio C HamanoNext: Junio C Hamano
Message 12 of 13 in “[BUG] Regression in 'git mergetool --tool-help'”
  1. Philippe BlainDec 19, 2020
  2. Felipe ContrerasDec 19, 2020
  3. Junio C HamanoDec 19, 2020
  4. Felipe ContrerasDec 19, 2020
  5. Junio C HamanoDec 19, 2020
  6. Philippe BlainDec 20, 2020
  7. Johannes SixtDec 20, 2020
  8. René ScharfeDec 20, 2020
  9. Junio C HamanoDec 20, 2020
  10. Philippe BlainDec 20, 2020
  11. Junio C HamanoDec 21, 2020
  12. Junio C HamanoDec 20, 2020
  13. Junio C HamanoDec 19, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.