Subject: Re: [PATCH v2 0/8] git-submodule.sh: improve parsing of options

From: Junio C Hamano <[email-masked]>
Date: Wed, 11 Dec 2024 09:02:07 +0900

Roy E <[email-masked]> writes:

>> I am assuming (but I don't use "git submodule" very often, so my
>> assumption may be way off) that there is no such variable we need to
>> pass, but if not, we may need to reconsider and use the "variable has
>> only value of the option" for at least some of them.
>
> Indeed, there aren't such variables; all of the options which take
> arguments have exactly one argument.

Just to make sure we are on the same page,

    --foo "hello world"

is an example of an option "foo" that takes exactly one argument, a
string which happens to have a whitespace in it, and is an example
for which "variable has the dash-dash option, equals, and its value"
pattern would not work well.

If we pass an argument that is an end-user provided message or is a
project controlled pathname, we are likely to be in the same
situation.

If we can pass it as

    --foo="hello world"

then we are safe, as we can do

	foo="--foo=hello world"
	... later ...
	git cmd ${foo:+"$foo"}