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>
This commit is contained in:
parent
bd1fc628b8
commit
a858c006fa
14
git-fetch.sh
14
git-fetch.sh
@ -26,6 +26,7 @@ keep=
|
|||||||
shallow_depth=
|
shallow_depth=
|
||||||
no_progress=
|
no_progress=
|
||||||
test -t 1 || no_progress=--no-progress
|
test -t 1 || no_progress=--no-progress
|
||||||
|
quiet=
|
||||||
while case "$#" in 0) break ;; esac
|
while case "$#" in 0) break ;; esac
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
@ -56,6 +57,9 @@ do
|
|||||||
--update-head-o|--update-head-ok)
|
--update-head-o|--update-head-ok)
|
||||||
update_head_ok=t
|
update_head_ok=t
|
||||||
;;
|
;;
|
||||||
|
-q|--q|--qu|--qui|--quie|--quiet)
|
||||||
|
quiet=--quiet
|
||||||
|
;;
|
||||||
-v|--verbose)
|
-v|--verbose)
|
||||||
verbose=Yes
|
verbose=Yes
|
||||||
;;
|
;;
|
||||||
@ -337,7 +341,8 @@ fetch_main () {
|
|||||||
expr "z$head" : "z$_x40\$" >/dev/null ||
|
expr "z$head" : "z$_x40\$" >/dev/null ||
|
||||||
die "No such ref $remote_name at $remote"
|
die "No such ref $remote_name at $remote"
|
||||||
echo >&2 "Fetching $remote_name from $remote using $proto"
|
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://*)
|
rsync://*)
|
||||||
test -n "$shallow_depth" &&
|
test -n "$shallow_depth" &&
|
||||||
@ -346,8 +351,9 @@ fetch_main () {
|
|||||||
rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
|
rsync -L -q "$remote/$remote_name" "$TMP_HEAD" || exit 1
|
||||||
head=$(git-rev-parse --verify TMP_HEAD)
|
head=$(git-rev-parse --verify TMP_HEAD)
|
||||||
rm -f "$TMP_HEAD"
|
rm -f "$TMP_HEAD"
|
||||||
|
case "$quiet" in '') v=-v ;; *) v= ;; esac
|
||||||
test "$rsync_slurped_objects" || {
|
test "$rsync_slurped_objects" || {
|
||||||
rsync -av --ignore-existing --exclude info \
|
rsync -a $v --ignore-existing --exclude info \
|
||||||
"$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
|
"$remote/objects/" "$GIT_OBJECT_DIRECTORY/" || exit
|
||||||
|
|
||||||
# Look at objects/info/alternates for rsync -- http will
|
# Look at objects/info/alternates for rsync -- http will
|
||||||
@ -394,8 +400,8 @@ fetch_main () {
|
|||||||
git-bundle unbundle "$remote" $rref ||
|
git-bundle unbundle "$remote" $rref ||
|
||||||
echo failed "$remote"
|
echo failed "$remote"
|
||||||
else
|
else
|
||||||
git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \
|
git-fetch-pack --thin $exec $keep $shallow_depth \
|
||||||
"$remote" $rref ||
|
$quiet $no_progress "$remote" $rref ||
|
||||||
echo failed "$remote"
|
echo failed "$remote"
|
||||||
fi
|
fi
|
||||||
) |
|
) |
|
||||||
|
Loading…
Reference in New Issue
Block a user