Re: [PATCH] Do not ignore merge options in interactive rebase
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 24, 2013, 14:16 UTC
- Message-ID
- <7vd2rbd26e.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <87bo6wyn0z.fsf@duckcorp.org>
Arnaud Fontaine <arnau@debian.org> writes:
Show 6 quoted lines
>>> + $(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.