From: Jens Lehmann <Jens.Lehmann@web.de>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>, Jeff King <peff@peff.net>
Subject: [PATCH] submodule status: properly pass options with --recursive
Date: Fri, 26 Oct 2012 00:20:29 +0200 [thread overview]
Message-ID: <5089BB2D.90400@web.de> (raw)
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 now. This clears
all options when recursing, as that variable is never set.
Fix that by renaming orig_args to orig_flags there too and add a test to
catch that bug.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
I noticed that when reviewing Phil's "Teach --recursive to submodule
sync" patch.
git-submodule.sh | 2 +-
t/t7407-submodule-foreach.sh | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/git-submodule.sh b/git-submodule.sh
index ab6b110..c089d48 100755
--- a/git-submodule.sh
+++ b/git-submodule.sh
@@ -990,7 +990,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
diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh
index 9b69fe2..eca36b5 100755
--- a/t/t7407-submodule-foreach.sh
+++ b/t/t7407-submodule-foreach.sh
@@ -245,6 +245,14 @@ test_expect_success 'ensure "status --cached --recursive" preserves the --cached
test_cmp expect actual
'
+test_expect_success 'ensure "status --quiet --recursive" preserves the --quiet flag' '
+ (
+ cd clone3 &&
+ git submodule status --quiet --recursive -- nested1 > ../actual
+ ) &&
+ ! test -s actual
+'
+
test_expect_success 'use "git clone --recursive" to checkout all submodules' '
git clone --recursive super clone4 &&
(
--
1.8.0.dirty
next reply other threads:[~2012-10-25 22:20 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-25 22:20 Jens Lehmann [this message]
2012-10-26 13:15 ` [PATCH] submodule status: properly pass options with --recursive 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 ` [PATCH] submodule status: remove unused orig_* variables Jens Lehmann
2012-10-29 7:27 ` 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=5089BB2D.90400@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
/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).