Re: [PATCH 3/3] difftool: Use eval to expand '--extcmd' expressions
- From
Johannes Sixt <j.sixt@viscovery.net>
- Date
- Jan 15, 2010, 08:40 UTC
- Message-ID
- <4B502A0C.50108@viscovery.net>
- In-Reply-To
- <1263539762-8269-3-git-send-email-davvid@gmail.com>
David Aguilar schrieb:
> - $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.
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