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

[PATCH] Pass $verbosity from git pull to git rebase

From
Iustin Pop <iusty@k1024.org>
Date
May 26, 2012, 01:00 UTC
Message-ID
<20120526010038.GA16694@hq.k1024.org>

Currently "git pull -q" only takes effect in merge mode, as commit 7f87aff2 (which introduced "git pull -q") only passes it to git-merge. This is not nice as a "git pull --rebase -q" will result in the "Current branch master is up to date.", instead of being quiet.

The patch adds a simple unit-test that checks that the initial pull, a pull that forwards the head, and a no-op pull are all silent.

Signed-off-by: Iustin Pop <iusty@k1024.org>
---
 Please keep me CC-ed, not subscribed to the list.
 git-pull.sh             |    2 +-
 t/t5521-pull-options.sh |   15 ++++++++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/git-pull.sh b/git-pull.sh
index 2a10047..2920c69 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -278,7 +278,7 @@ fi
 merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit
 case "$rebase" in
 true)
-	eval="git-rebase $diffstat $strategy_args $merge_args"
+	eval="git-rebase $diffstat $strategy_args $merge_args $verbosity"
 	eval="$eval --onto $merge_head ${oldremoteref:-$merge_head}"
 	;;
 *)
diff --git a/t/t5521-pull-options.sh b/t/t5521-pull-options.sh
index 1b06691..9735fb4 100755
--- a/t/t5521-pull-options.sh
+++ b/t/t5521-pull-options.sh
@@ -8,7 +8,9 @@ test_expect_success 'setup' '
 	mkdir parent &&
 	(cd parent && git init &&
 	 echo one >file && git add file &&
-	 git commit -m one)
+	 git commit -m one &&
+	 echo two >file && git add file &&
+	 git commit -m two)
 '
 
 test_expect_success 'git pull -q' '
@@ -19,6 +21,17 @@ test_expect_success 'git pull -q' '
 	test ! -s out)
 '
 
+test_expect_success 'git pull -q --rebase' '
+	mkdir clonedqr &&
+	(cd clonedqr && git init &&
+	git pull -q --rebase "../parent" >out 2>err &&
+	git reset --hard -q HEAD^ >>out 2>>err &&
+	git pull -q --rebase "../parent" >>out 2>>err &&
+	git pull -q --rebase "../parent" >>out 2>>err &&
+	test ! -s err &&
+	test ! -s out)
+'
+
 test_expect_success 'git pull' '
 	mkdir cloned &&
 	(cd cloned && git init &&
-- 
1.7.10
Message 1 of 1 in “Pass $verbosity from git pull to git rebase”
  1. Pass $verbosity from git pull to git rebaseIustin Pop, May 26, 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.