X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-pull.sh;h=8eb74d45debe7ab2bd2cc9b5ed57b1ba49d94bdb;hb=beb172172f3dc63b4e7ad671e34826fb812281f8;hp=1a4729f7bb29205fb7bc251887dcd4f5237f1659;hpb=60335534a6ac52d4d3a372a5b56df5a57a4463d1;p=git.git diff --git a/git-pull.sh b/git-pull.sh index 1a4729f7b..8eb74d45d 100755 --- a/git-pull.sh +++ b/git-pull.sh @@ -43,6 +43,7 @@ merge_args= curr_branch=$(git symbolic-ref -q HEAD) curr_branch_short="${curr_branch#refs/heads/}" rebase=$(git config --bool branch.$curr_branch_short.rebase) +dry_run= while : do case "$1" in @@ -104,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 ;; @@ -216,7 +220,8 @@ test true = "$rebase" && { done } orig_head=$(git rev-parse -q --verify HEAD) -git fetch $verbosity $progress --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" @@ -268,6 +273,15 @@ then exit fi +if test true = "$rebase" +then + o=$(git show-branch --merge-base $curr_branch $merge_head $oldremoteref) + if test "$oldremoteref" = "$o" + then + unset oldremoteref + fi +fi + merge_name=$(git fmt-merge-msg $log_arg <"$GIT_DIR/FETCH_HEAD") || exit case "$rebase" in true)