From: Iustin Pop <iusty@k1024.org>
To: git@vger.kernel.org
Subject: [PATCH] Pass $verbosity from git pull to git rebase
Date: Sat, 26 May 2012 03:00:09 +0200 [thread overview]
Message-ID: <20120526010009.GA16666@hq.k1024.org> (raw)
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
next reply other threads:[~2012-05-26 1:00 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-26 1:00 Iustin Pop [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-05-26 1:00 [PATCH] Pass $verbosity from git pull to git rebase Iustin Pop
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=20120526010009.GA16666@hq.k1024.org \
--to=iusty@k1024.org \
--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.
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).