Arnaud Fontaine <ar...@debian.org> writes:

>>> +                   $(echo $strategy_opts | sed "s/'--\([^']*\)'/-X\1/g") \
>>
>> Is it guaranteed $startegy_opts do not have a space in it?
>
> strategy_opts may be something like (git-rebase.sh): "'--foo' '--bar'",
> but I'm not sure what is wrong if there is a space in it though.

I was primarily worried  about "'--frotz=nitfol xyzzy'", where you
need to pass -X='frotz=nitfol xyzzy' so that 'xyzzy' part does not
become a separate argument directly given to 'git merge' and friends.

And adding '' around \1 is not sufficient, because the value given
to the "--frotz" may have to be "nitfol 'n xyzzy".

A comment next to that sed script that says "Currently there is no
strategy option that needs quoting" (if it is the case; I didn't
check), together with a guard to protect us against unexpected
strategy-opts, might be a workable band-aid, though.
        
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to