From: Junio C Hamano <gitster@pobox.com>
To: Heiko Voigt <hvoigt@hvoigt.net>
Cc: git@vger.kernel.org, jens.lehmann@web.de,
Stefan Zager <szager@google.com>
Subject: Re: [PATCH] cleanup argument passing in submodule status command
Date: Sat, 28 Jul 2012 23:22:55 -0700 [thread overview]
Message-ID: <7vtxwrw0g0.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120728121956.GA36429@book.hvoigt.net> (Heiko Voigt's message of "Sat, 28 Jul 2012 14:19:56 +0200")
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.
> 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
next prev parent reply other threads:[~2012-07-29 6:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-27 18:37 [PATCH] Enable parallelism in git submodule update Stefan Zager
2012-07-27 21:38 ` Junio C Hamano
[not found] ` <CAHOQ7J_jYAe7r1q6Cg9OJb8f+79UfS=JfRk9NrS4R4a+oLM8LA@mail.gmail.com>
2012-07-27 23:25 ` Junio C Hamano
2012-07-28 10:52 ` Heiko Voigt
2012-07-29 21:59 ` Junio C Hamano
2012-07-28 10:22 ` Heiko Voigt
2012-07-28 12:19 ` [PATCH] cleanup argument passing in submodule status command Heiko Voigt
2012-07-29 6:22 ` Junio C Hamano [this message]
2012-07-29 15:29 ` Jens Lehmann
2012-07-29 21:57 ` Junio C Hamano
2012-07-29 15:37 ` [PATCH] Enable parallelism in git submodule update Jens Lehmann
2012-11-03 19:07 ` Jens Lehmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vtxwrw0g0.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=hvoigt@hvoigt.net \
--cc=jens.lehmann@web.de \
--cc=szager@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).