git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] submodule status: properly pass options with --recursive

From
Jens Lehmann <jens.lehmann@web.de>
Date
Oct 25, 2012, 22:20 UTC
Message-ID
<5089BB2D.90400@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 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: Jeff King
Message 1 of 12 in “submodule status: properly pass options with --recursive”
  1. submodule status: properly pass options with --recursiveJens Lehmann, Oct 25, 2012
  2. Jeff KingOct 26, 2012
  3. Phil HordOct 26, 2012
  4. t7407: Fix recursive submodule testPhil Hord, Oct 26, 2012
  5. Jens LehmannOct 26, 2012
  6. submodule status: remove unused orig_* variablesJens Lehmann, Oct 28, 2012
  7. Jeff KingOct 29, 2012
  8. Jens LehmannOct 26, 2012
  9. 0/2 Teach --recursive to submodule syncPhil Hord, Oct 26, 2012
  10. 1/2 Teach --recursive to submodule syncPhil Hord, Oct 26, 2012
  11. 2/2 Add tests for submodule sync --recursivePhil Hord, Oct 26, 2012
  12. Jens LehmannOct 28, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.