git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Theodore Dubois <tbodt@google.com>
To: git@vger.kernel.org
Cc: Theodore Dubois <tbodt@google.com>
Subject: [PATCH v2] Propagate --quiet on submodule update to merge/rebase
Date: Wed, 30 Sep 2020 12:50:53 -0700	[thread overview]
Message-ID: <20200930195052.118199-1-tbodt@google.com> (raw)

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

Also fix the parsing of git submodule update -v. Setting GIT_QUIET to 0
has the same effect as setting GIT_QUIET to 1, because
${GIT_QUIET:+--quiet} only checks whether GIT_QUIET is set or unset.

Signed-off-by: Theodore Dubois <tbodt@google.com>
---
 git-submodule.sh            |  6 +++---
 t/t7406-submodule-update.sh | 12 ++++++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git git-submodule.sh git-submodule.sh
index 6fb12585cb..7ce52872b7 100755
--- git-submodule.sh
+++ git-submodule.sh
@@ -440,7 +440,7 @@ cmd_update()
 			GIT_QUIET=1
 			;;
 		-v)
-			GIT_QUIET=0
+			unset GIT_QUIET
 			;;
 		--progress)
 			progress=1
@@ -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..acb8766ac2 100755
--- t/t7406-submodule-update.sh
+++ t/t7406-submodule-update.sh
@@ -1022,4 +1022,16 @@ 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 &&
+	 git submodule update --rebase -v >out 2>err &&
+	 test_file_not_empty out &&
+	 test_must_be_empty err
+	)
+'
+
 test_done
-- 
2.28.0.709.gb0816b6eb0-goog


             reply	other threads:[~2020-09-30 19:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-30 19:50 Theodore Dubois [this message]
2020-09-30 20:58 ` [PATCH v2] Propagate --quiet on submodule update to merge/rebase Junio C Hamano
2020-09-30 21:04   ` Eric Sunshine
2020-10-01  5:38   ` Jonathan Nieder
2020-10-01 15:49     ` Junio C Hamano

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=20200930195052.118199-1-tbodt@google.com \
    --to=tbodt@google.com \
    --cc=git@vger.kernel.org \
    /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).