Teach/Fix pull/fetch -q/-v options
Implement git-pull --quiet and git-pull --verbose by adding the options to git-pull and fixing verbosity handling in git-fetch. Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
a0d3ab9c27
commit
7f87aff22c
10
git-pull.sh
10
git-pull.sh
@ -16,13 +16,17 @@ cd_to_toplevel
|
||||
test -z "$(git ls-files -u)" ||
|
||||
die "You are in the middle of a conflicted merge."
|
||||
|
||||
strategy_args= no_stat= no_commit= squash= no_ff= log_arg=
|
||||
strategy_args= no_stat= no_commit= squash= no_ff= log_arg= verbosity=
|
||||
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)
|
||||
while :
|
||||
do
|
||||
case "$1" in
|
||||
-q|--quiet)
|
||||
verbosity=-q ;;
|
||||
-v|--verbose)
|
||||
verbosity=-v ;;
|
||||
-n|--no-stat|--no-summary)
|
||||
no_stat=-n ;;
|
||||
--stat|--summary)
|
||||
@ -121,7 +125,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 $verbosity --update-head-ok "$@" || exit 1
|
||||
|
||||
curr_head=$(git rev-parse --verify HEAD 2>/dev/null)
|
||||
if test -n "$orig_head" && test "$curr_head" != "$orig_head"
|
||||
@ -182,4 +186,4 @@ test true = "$rebase" &&
|
||||
exec git-rebase $strategy_args --onto $merge_head \
|
||||
${oldremoteref:-$merge_head}
|
||||
exec git-merge $no_stat $no_commit $squash $no_ff $log_arg $strategy_args \
|
||||
"$merge_name" HEAD $merge_head
|
||||
"$merge_name" HEAD $merge_head $verbosity
|
||||
|
||||
Reference in New Issue
Block a user