Thread (6 messages) flat view 6 messages, 4 authors, 2020-12-21

Re: [BUG] Regression in 'git mergetool --tool-help'

From: Junio C Hamano <hidden>
Date: 2020-12-20 15:35:12

Possibly related (same subject, not in this thread)

Philippe Blain [off-list ref] 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"?
quoted hunk ↗ jump to hunk
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)"
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help