From: Junio C Hamano Date: Mon, 24 Jun 2013 14:16:25 GMT Subject: Re: [PATCH] Do not ignore merge options in interactive rebase Message-ID: <7vd2rbd26e.fsf@alter.siamese.dyndns.org> In-Reply-To: <87bo6wyn0z.fsf@duckcorp.org> Arnaud Fontaine 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.