git-fetch: add --quiet
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>
Junio C Hamano committed
Feb 25, 2007 at 13:13 UTC
a858c006fae17cef44dd63737771f2bebb6eeae8
1 file changed
+10
-4
git-fetch.sh
+10
-4
@@ -26,6 +26,7 @@ keep=
26
shallow_depth=
27
no_progress=
28
test -t 1 || no_progress=--no-progress
29
+quiet=
30
while case "$#" in 0) break ;; esac
31
do
32
case "$1" in
@@ -56,6 +57,9 @@ do
57
--update-head-o|--update-head-ok)
58
update_head_ok=t
59
;;
60
+ -q|--q|--qu|--qui|--quie|--quiet)
61
+ quiet=--quiet
62
+ ;;
63
-v|--verbose)
64
verbose=Yes
65
;;
@@ -337,7 +341,8 @@ fetch_main () {
341
expr "z$head" : "z$_x40\$" >/dev/null ||
342
die "No such ref $remote_name at $remote"
343
echo >&2 "Fetching $remote_name from $remote using $proto"
340
- git-http-fetch -v -a "$head" "$remote/" || exit
344
+ case "$quiet" in '') v=-v ;; *) v= ;; esac
345
+ git-http-fetch $v -a "$head" "$remote/" || exit
346
;;
347
rsync://*)
348
test -n "$shallow_depth" &&
@@ -346,8 +351,9 @@ fetch_main () {
351
rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
352
head=$(git-rev-parse --verify TMP_HEAD)
353
rm -f "$TMP_HEAD"
354
+ case "$quiet" in '') v=-v ;; *) v= ;; esac
355
test "$rsync_slurped_objects" || {
350
- rsync -av --ignore-existing --exclude info \
356
+ rsync -a $v --ignore-existing --exclude info \
357
"$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
358
359
# Look at objects/info/alternates for rsync -- http will
@@ -394,8 +400,8 @@ fetch_main () {
400
git-bundle unbundle "$remote" $rref ||
401
echo failed "$remote"
402
else
397
- git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \
398
- "$remote" $rref ||
403
+ git-fetch-pack --thin $exec $keep $shallow_depth \
404
+ $quiet $no_progress "$remote" $rref ||
405
echo failed "$remote"
406
fi
407
) |