X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;f=git-pull.sh;h=8eb74d45debe7ab2bd2cc9b5ed57b1ba49d94bdb;hb=1d50bfd9c7ae6a0bc7d60b34162c56c670db540d;hp=5dbc4387f75658689bae24c294159bd91ed5c544;hpb=cf65426de682bf4e336eddd2964a7c1585597f48;p=thirdparty%2Fgit.git diff --git a/git-pull.sh b/git-pull.sh index 5dbc4387f7..8eb74d45de 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -38,11 +38,12 @@ test -z "$(git ls-files -u)" || die_conflict test -f "$GIT_DIR/MERGE_HEAD" && die_merge strategy_args= diffstat= no_commit= squash= no_ff= ff_only= -log_arg= verbosity= +log_arg= verbosity= progress= merge_args= curr_branch=$(git symbolic-ref -q HEAD) -curr_branch_short=$(echo "$curr_branch" | sed "s|refs/heads/||") +curr_branch_short="${curr_branch#refs/heads/}" rebase=$(git config --bool branch.$curr_branch_short.rebase) +dry_run= while : do case "$1" in @@ -50,6 +51,8 @@ do verbosity="$verbosity -q" ;; -v|--verbose) verbosity="$verbosity -v" ;; + --progress) + progress=--progress ;; -n|--no-stat|--no-summary) diffstat=--no-stat ;; --stat|--summary) @@ -102,6 +105,9 @@ do --no-r|--no-re|--no-reb|--no-reba|--no-rebas|--no-rebase) rebase=false ;; + --d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run) + dry_run=--dry-run + ;; -h|--h|--he|--hel|--help) usage ;; @@ -214,7 +220,8 @@ test true = "$rebase" && { done } orig_head=$(git rev-parse -q --verify HEAD) -git fetch $verbosity --update-head-ok "$@" || exit 1 +git fetch $verbosity $progress $dry_run --update-head-ok "$@" || exit 1 +test -z "$dry_run" || exit 0 curr_head=$(git rev-parse -q --verify HEAD) if test -n "$orig_head" && test "$curr_head" != "$orig_head"