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

[PATCH] Propagate --quiet on submodule update to merge/rebase

From
Theodore Dubois <tbodt@google.com>
Date
Sep 30, 2020, 07:47 UTC
Message-ID
<20200930074729.99629-1-tbodt@google.com>

Without this, commands such as git pull --rebase --recurse-submodules --quiet might produce non-quiet output from the merge or rebase.

Signed-off-by: Theodore Dubois <tbodt@google.com>
---
 git-submodule.sh            | 4 ++--
 t/t7406-submodule-update.sh | 9 +++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)
diff --git git-submodule.sh git-submodule.sh
index 6fb12585cb..5c22b17221 100755
--- git-submodule.sh
+++ git-submodule.sh
@@ -614,13 +614,13 @@ cmd_update()
 				say_msg="$(eval_gettext "Submodule path '\$displaypath': checked out '\$sha1'")"
 				;;
 			rebase)
-				command="git rebase"
+				command="git rebase ${GIT_QUIET:+--quiet}"
 				die_msg="$(eval_gettext "Unable to rebase '\$sha1' in submodule path '\$displaypath'")"
 				say_msg="$(eval_gettext "Submodule path '\$displaypath': rebased into '\$sha1'")"
 				must_die_on_failure=yes
 				;;
 			merge)
-				command="git merge"
+				command="git merge ${GIT_QUIET:+--quiet}"
 				die_msg="$(eval_gettext "Unable to merge '\$sha1' in submodule path '\$displaypath'")"
 				say_msg="$(eval_gettext "Submodule path '\$displaypath': merged in '\$sha1'")"
 				must_die_on_failure=yes
diff --git t/t7406-submodule-update.sh t/t7406-submodule-update.sh
index aa19ff3a2e..5213e47af8 100755
--- t/t7406-submodule-update.sh
+++ t/t7406-submodule-update.sh
@@ -1022,4 +1022,13 @@ test_expect_success 'git clone passes the parallel jobs config on to submodules'
 	rm -rf super4
 '
 
+test_expect_success 'submodule update --quiet passes quietness to merge/rebase' '
+	(cd super &&
+	 test_commit -C rebasing message &&
+	 git submodule update --rebase --quiet >out 2>err &&
+	 test_must_be_empty out &&
+	 test_must_be_empty err
+	)
+'
+
 test_done
-- 
2.28.0.709.gb0816b6eb0-goog
Next: Junio C Hamano
Message 1 of 4 in “Propagate --quiet on submodule update to merge/rebase”
  1. Propagate --quiet on submodule update to merge/rebaseTheodore Dubois, Sep 30, 2020
  2. Junio C HamanoSep 30, 2020
  3. Theodore DuboisSep 30, 2020
  4. Junio C HamanoSep 30, 2020

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.