git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Iustin Pop <iusty@k1024.org>
To: git@vger.kernel.org
Cc: Iustin Pop <iusty@k1024.org>
Subject: [PATCH 2/2] Fix git pull handling of the quiet option
Date: Sun,  9 Mar 2008 00:52:36 +0100	[thread overview]
Message-ID: <1205020356-6682-3-git-send-email-iusty@k1024.org> (raw)
In-Reply-To: <1205020356-6682-1-git-send-email-iusty@k1024.org>

Although git pull has a documented quiet option, currently it doesn't
handle this option at all, and this results in it terminating the
handling of command line options when this particular option is met.

More exactly, it will cause the following invocation:
  git pull --quiet --no-commit
to fail with:
  error: unknown option `no-commit'
  usage: git-fetch [options] [<repository> <refspec>...]
because it will not look at anything after quiet (and no-commit and
other options should not be passed to git fetch).

This patch adds the handling of this option, and passes it correctly to
both git fetch and git merge (and therefore needs to be applied on top
of patched git merge).
---
 git-pull.sh |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/git-pull.sh b/git-pull.sh
index 3ce32b5..2201ca0 100755
--- a/git-pull.sh
+++ b/git-pull.sh
@@ -16,7 +16,7 @@ cd_to_toplevel
 test -z "$(git ls-files -u)" ||
 	die "You are in the middle of a conflicted merge."
 
-strategy_args= no_summary= no_commit= squash= no_ff=
+strategy_args= no_summary= no_commit= squash= no_ff= quiet=
 curr_branch=$(git symbolic-ref -q HEAD)
 curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||")
 rebase=$(git config --bool branch.$curr_branch_short.rebase)
@@ -61,6 +61,8 @@ do
 	--no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase)
 		rebase=false
 		;;
+	-q|--q|--qui|--quie|--quiet)
+		quiet=--quiet ;;
 	-h|--h|--he|--hel|--help)
 		usage
 		;;
@@ -116,7 +118,7 @@ test true = "$rebase" && {
 		"refs/remotes/$origin/$reflist" 2>/dev/null)"
 }
 orig_head=$(git rev-parse --verify HEAD 2>/dev/null)
-git-fetch --update-head-ok "$@" || exit 1
+git-fetch $quiet --update-head-ok "$@" || exit 1
 
 curr_head=$(git rev-parse --verify HEAD 2>/dev/null)
 if test "$curr_head" != "$orig_head"
@@ -177,4 +179,4 @@ test true = "$rebase" &&
 	exec git-rebase $strategy_args --onto $merge_head \
 	${oldremoteref:-$merge_head}
 exec git-merge $no_summary $no_commit $squash $no_ff $strategy_args \
-	"$merge_name" HEAD $merge_head
+	$quiet "$merge_name" HEAD $merge_head
-- 
1.5.4.3


  parent reply	other threads:[~2008-03-08 23:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-08 23:52 Improve git pull --quiet behaviour Iustin Pop
2008-03-08 23:52 ` [PATCH 1/2] Add a quiet option to git merge Iustin Pop
2008-03-09 12:18   ` [PATCH] " Iustin Pop
2008-03-08 23:52 ` Iustin Pop [this message]
2008-03-09  4:04   ` [PATCH 2/2] Fix git pull handling of the quiet option Junio C Hamano
2008-03-09 10:31     ` Iustin Pop
2008-03-09 22:31     ` [PATCH] " 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=1205020356-6682-3-git-send-email-iusty@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).