Thread (5 messages) flat view 5 messages, 2 authors, 2016-06-15

Re: [PATCH 3/3] difftool: Use eval to expand '--extcmd' expressions

From: David Aguilar <hidden>
Date: 2016-06-15 22:48:02

On Fri, Jan 15, 2010 at 09:40:44AM +0100, Johannes Sixt wrote:
David Aguilar schrieb:
quoted
-		$GIT_DIFFTOOL_EXTCMD "$LOCAL" "$REMOTE"
+		(eval $GIT_DIFFTOOL_EXTCMD "\"$LOCAL\"" "\"$REMOTE\"")
The new code is broken if $LOCAL or $REMOTE can contain double-quotes. How
about this alternative:

		eval $GIT_DIFFTOOL_EXTCMD '"$LOCAL"' '"$REMOTE"'

which I find more readable as well.
I'll resend a patch later today (can't quite right now, but will
have time later).
What's the reason for the sub-shell? Do you want to protect from shell
code in $GIT_DIFFTOOL_EXTCMD that modifies difftool's variables?

-- Hannes
None, really, so we can do without that as well.

Thanks for your notes,

-- 
		David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help