From: Jens Lehmann <Jens.Lehmann@web.de>
To: Phil Hord <hordp@cisco.com>
Cc: Git Mailing List <git@vger.kernel.org>,
phil.hord@gmail.com, Jeff King <peff@peff.net>
Subject: [PATCH] submodule status: remove unused orig_* variables
Date: Sun, 28 Oct 2012 22:37:16 +0100 [thread overview]
Message-ID: <508DA58C.2040504@web.de> (raw)
In-Reply-To: <508AE4AB.4070209@web.de>
When renaming orig_args to orig_flags in 98dbe63d (submodule: only
preserve flags across recursive status/update invocations) the call site
of the recursive cmd_status was forgotten. At that place orig_args is
still passed into the recursion, which is always empty since then. This
did not break anything because the orig_flags logic is not needed at all
when a function from the submodule script is called with eval, as that
inherits all the variables set by the option parsing done in the first
level of the recursion.
Now that we know that orig_flags and orig_args aren't needed at all,
let's just remove them from cmd_status().
Thanks-to: Phil Hord <hordp@cisco.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
Am 26.10.2012 21:29, schrieb Jens Lehmann:
> Am 26.10.2012 21:13, schrieb Phil Hord:
>> A test in t7404-submodule-foreach purports to test that
>> the --cached flag is properly noticed by --recursive calls
>> to the foreach command as it descends into nested
>> submodules. However, the test really does not perform this
>> test since the change it looks for is in a top-level
>> submodule handled by the first invocation of the command.
>> To properly test for the flag being passed to recursive
>> invocations, the change must be buried deeper in the
>> hierarchy.
>>
>> Move the change one level deeper so it properly verifies
>> the recursive machinery of the 'git submodule status'
>> command.
>
> Me thinks we should definitely do this.
And I also think this patch should go on top of Phil's patch after what
we learned so far.
I'm currently checking if we can also safely remove orig_flags from
cmd_update(). At least the test suite runs fine without it ...
git-submodule.sh | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index ab6b110..c287464 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -926,7 +926,6 @@ cmd_summary() {
cmd_status()
{
# parse $args after "submodule ... status".
- orig_flags=
while test $# -ne 0
do
case "$1" in
@@ -950,7 +949,6 @@ cmd_status()
break
;;
esac
- orig_flags="$orig_flags $(git rev-parse --sq-quote "$1")"
shift
done
@@ -990,7 +988,7 @@ cmd_status()
prefix="$displaypath/"
clear_local_git_env
cd "$sm_path" &&
- eval cmd_status "$orig_args"
+ eval cmd_status
) ||
die "$(eval_gettext "Failed to recurse into submodule path '\$sm_path'")"
fi
--
1.8.0.42.g2ea983b
next prev parent reply other threads:[~2012-10-28 21:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 22:20 [PATCH] submodule status: properly pass options with --recursive Jens Lehmann
2012-10-26 13:15 ` Jeff King
2012-10-26 19:07 ` Phil Hord
2012-10-26 19:13 ` [PATCH] t7407: Fix recursive submodule test Phil Hord
2012-10-26 19:29 ` Jens Lehmann
2012-10-28 21:37 ` Jens Lehmann [this message]
2012-10-29 7:27 ` [PATCH] submodule status: remove unused orig_* variables Jeff King
2012-10-26 19:26 ` [PATCH] submodule status: properly pass options with --recursive Jens Lehmann
2012-10-26 19:44 ` [PATCHv3 0/2] Teach --recursive to submodule sync Phil Hord
2012-10-26 19:44 ` [PATCHv3 1/2] " Phil Hord
2012-10-26 19:44 ` [PATCHv3 2/2] Add tests for submodule sync --recursive Phil Hord
2012-10-28 21:02 ` [PATCHv3 0/2] Teach --recursive to submodule sync 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=508DA58C.2040504@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=hordp@cisco.com \
--cc=peff@peff.net \
--cc=phil.hord@gmail.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.
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 NNTP newsgroup(s).