Re: [PATCH] cleanup argument passing in submodule status command
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 29, 2012, 06:22 UTC
- Message-ID
- <7vtxwrw0g0.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20120728121956.GA36429@book.hvoigt.net>
Heiko Voigt <hvoigt@hvoigt.net> writes:
> Note: This is a code cleanup and does not fix any bugs. As a side effect > the variables containing the parsed flags to "git submodule status" are > passed down recursively. So everything was already behaving as expected.
If that is the case, shouldn't we stop passing anything down, if we want it to be a "clean-up only, no behaviour changes" patch? While at it, we may want to kill that code to accumulate the original options in orig_flags because we haven't been using the variable.
We _know_ $orig_args has been empty, i.e. the code has been working fine with only cmd_status there. Nobody has tried what happens when we pass the original arguments to cmd_status on that line. The patch changes the behaviour of the code; it makes the command line parsing "while" loop to run again, and if the code that accumulates original options in orig_flags have been buggy, now that bug will be exposed.
Show 18 quoted lines
> Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> > --- > git-submodule.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/git-submodule.sh b/git-submodule.sh > index dba4d39..3a3f0a4 100755 > --- a/git-submodule.sh > +++ b/git-submodule.sh > @@ -961,7 +961,7 @@ cmd_status() > prefix="$displaypath/" > clear_local_git_env > cd "$sm_path" && > - eval cmd_status "$orig_args" > + eval cmd_status "$orig_flags" > ) || > die "$(eval_gettext "Failed to recurse into submodule path '\$sm_path'")" > fi