From: Junio C Hamano Date: Fri, 28 Mar 2014 20:51:20 +0000 (-0700) Subject: Merge branch 'bg/rebase-off-of-previous-branch' X-Git-Tag: v2.0.0-rc0~52 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/97345145ff33286af6c14260432f5edfb56fdc82?ds=inline;hp=-c Merge branch 'bg/rebase-off-of-previous-branch' * bg/rebase-off-of-previous-branch: rebase: allow "-" short-hand for the previous branch --- 97345145ff33286af6c14260432f5edfb56fdc82 diff --combined git-rebase.sh index 5f6732bf3d,658c003c14..2c75e9fa0f --- a/git-rebase.sh +++ b/git-rebase.sh @@@ -5,7 -5,6 +5,7 @@@ SUBDIRECTORY_OK=Yes OPTIONS_KEEPDASHDASH= +OPTIONS_STUCKLONG=t OPTIONS_SPEC="\ git rebase [-i] [options] [--exec ] [--onto ] [] [] git rebase [-i] [options] [--exec ] [--onto ] --root [] @@@ -37,7 -36,6 +37,7 @@@ ignore-date! passed to 'git am whitespace=! passed to 'git apply' ignore-whitespace! passed to 'git apply' C=! passed to 'git apply' +S,gpg-sign? GPG-sign commits Actions: continue! continue abort! abort and check out the original branch @@@ -86,7 -84,6 +86,7 @@@ preserve_merges autosquash= keep_empty= test "$(git config --bool rebase.autosquash)" = "true" && autosquash=t +gpg_sign_opt= read_basic_state () { test -f "$state_dir/head-name" && @@@ -109,8 -106,6 +109,8 @@@ strategy_opts="$(cat "$state_dir"/strategy_opts)" test -f "$state_dir"/allow_rerere_autoupdate && allow_rerere_autoupdate="$(cat "$state_dir"/allow_rerere_autoupdate)" + test -f "$state_dir"/gpg_sign_opt && + gpg_sign_opt="$(cat "$state_dir"/gpg_sign_opt)" } write_basic_state () { @@@ -124,7 -119,6 +124,7 @@@ "$state_dir"/strategy_opts test -n "$allow_rerere_autoupdate" && echo "$allow_rerere_autoupdate" > \ "$state_dir"/allow_rerere_autoupdate + test -n "$gpg_sign_opt" && echo "$gpg_sign_opt" > "$state_dir"/gpg_sign_opt } output () { @@@ -242,19 -236,23 +242,19 @@@ d test $total_argc -eq 2 || usage action=${1##--} ;; - --onto) - test 2 -le "$#" || usage - onto="$2" - shift + --onto=*) + onto="${1#--onto=}" ;; - -x) - test 2 -le "$#" || usage - cmd="${cmd}exec $2${LF}" - shift + --exec=*) + cmd="${cmd}exec ${1#--exec=}${LF}" ;; - -i) + --interactive) interactive_rebase=explicit ;; - -k) + --keep-empty) keep_empty=yes ;; - -p) + --preserve-merges) preserve_merges=t test -z "$interactive_rebase" && interactive_rebase=implied ;; @@@ -270,19 -268,21 +270,19 @@@ --no-fork-point) fork_point= ;; - -M|-m) + --merge) do_merge=t ;; - -X) - shift - strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--$1")" + --strategy-option=*) + strategy_opts="$strategy_opts $(git rev-parse --sq-quote "--${1#--strategy-option=}")" do_merge=t test -z "$strategy" && strategy=recursive ;; - -s) - shift - strategy="$1" + --strategy=*) + strategy="${1#--strategy=}" do_merge=t ;; - -n) + --no-stat) diffstat= ;; --stat) @@@ -291,20 -291,21 +291,20 @@@ --autostash) autostash=true ;; - -v) + --verbose) verbose=t diffstat=t GIT_QUIET= ;; - -q) + --quiet) GIT_QUIET=t git_am_opt="$git_am_opt -q" verbose= diffstat= ;; - --whitespace) - shift - git_am_opt="$git_am_opt --whitespace=$1" - case "$1" in + --whitespace=*) + git_am_opt="$git_am_opt --whitespace=${1#--whitespace=}" + case "${1#--whitespace=}" in fix|strip) force_rebase=t ;; @@@ -317,24 -318,19 +317,24 @@@ git_am_opt="$git_am_opt $1" force_rebase=t ;; - -C) - shift - git_am_opt="$git_am_opt -C$1" + -C*) + git_am_opt="$git_am_opt $1" ;; --root) rebase_root=t ;; - -f|--no-ff) + --force-rebase|--no-ff) force_rebase=t ;; --rerere-autoupdate|--no-rerere-autoupdate) allow_rerere_autoupdate="$1" ;; + --gpg-sign) + gpg_sign_opt=-S + ;; + --gpg-sign=*) + gpg_sign_opt="-S${1#--gpg-sign=}" + ;; --) shift break @@@ -453,6 -449,10 +453,10 @@@ the test "$fork_point" = auto && fork_point=t ;; *) upstream_name="$1" + if test "$upstream_name" = "-" + then + upstream_name="@{-1}" + fi shift ;; esac