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

[PATCH] git-fetch: add --quiet

From
Junio C Hamano <junkio@cox.net>
Date
Feb 25, 2007, 21:29 UTC
Message-ID
<7vzm72q633.fsf@assigned-by-dhcp.cox.net>

Pass it to underlying fetch-pack, and also have it affect if -v is passed to http-fetch and rsync.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * As I am only using git native protocols these days myself, I
   did not check http or rsync -- they might be broken.  Tests
   and fixes are appreciated from people who care about them
   ;-).
 git-fetch.sh |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/git-fetch.sh b/git-fetch.sh
index 851ed6b..0b4922b 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -26,6 +26,7 @@ keep=
 shallow_depth=
 no_progress=
 test -t 1 || no_progress=--no-progress
+quiet=
 while case "$#" in 0) break ;; esac
 do
 	case "$1" in
@@ -56,6 +57,9 @@ do
 	--update-head-o|--update-head-ok)
 		update_head_ok=t
 		;;
+	-q|--q|--qu|--qui|--quie|--quiet)
+		quiet=--quiet
+		;;
 	-v|--verbose)
 		verbose=Yes
 		;;
@@ -328,7 +332,8 @@ fetch_main () {
 	  expr "z$head" : "z$_x40\$" >/dev/null ||
 		die "No such ref $remote_name at $remote"
 	  echo >&2 "Fetching $remote_name from $remote using $proto"
-	  git-http-fetch -v -a "$head" "$remote/" || exit
+	  case "$quiet" in '') v=-v ;; *) v= ;; esac
+	  git-http-fetch $v -a "$head" "$remote/" || exit
 	  ;;
       rsync://*)
 	  test -n "$shallow_depth" &&
@@ -337,8 +342,9 @@ fetch_main () {
 	  rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
 	  head=$(git-rev-parse --verify TMP_HEAD)
 	  rm -f "$TMP_HEAD"
+	  case "$quiet" in '') v=-v ;; *) v= ;; esac
 	  test "$rsync_slurped_objects" || {
-	      rsync -av --ignore-existing --exclude info \
+	      rsync -a $v --ignore-existing --exclude info \
 		  "$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
 
 	      # Look at objects/info/alternates for rsync -- http will
@@ -379,8 +385,8 @@ fetch_main () {
     ( : subshell because we muck with IFS
       IFS=" 	$LF"
       (
-	  git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \
-		"$remote" $rref ||
+	  git-fetch-pack --thin $exec $keep $shallow_depth \
+	      $quiet $no_progress "$remote" $rref ||
 	  echo failed "$remote"
       ) |
       (
-- 
1.5.0.1.791.g4c9a
Message 1 of 1 in “git-fetch: add --quiet”
  1. git-fetch: add --quietJunio C Hamano, Feb 25, 2007

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.