From: Junio C Hamano Date: Fri, 26 Apr 2013 22:28:34 +0000 (-0700) Subject: Merge branch 'ph/rebase-original' X-Git-Tag: v1.8.3-rc0~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d1ab71804fe2afff4afa664c46a938a72fd237a7?hp=-c Merge branch 'ph/rebase-original' * ph/rebase-original: rebase: find orig_head unambiguously --- d1ab71804fe2afff4afa664c46a938a72fd237a7 diff --combined git-rebase.sh index b2f1c76dc3,d6c52e6f90..2c692c33e9 --- a/git-rebase.sh +++ b/git-rebase.sh @@@ -8,7 -8,7 +8,7 @@@ OPTIONS_KEEPDASHDASH OPTIONS_SPEC="\ git rebase [-i] [options] [--exec ] [--onto ] [] [] git rebase [-i] [options] [--exec ] [--onto ] --root [] -git-rebase [-i] --continue | --abort | --skip +git-rebase --continue | --abort | --skip | --edit-todo -- Available options are v,verbose! display a diffstat of what changed upstream @@@ -38,7 -38,6 +38,7 @@@ C=! passed to 'git apply continue! continue abort! abort and check out the original branch skip! skip current patch and continue +edit-todo! edit the todo list during an interactive rebase " . git-sh-setup . git-sh-i18n @@@ -191,7 -190,7 +191,7 @@@ d --verify) ok_to_skip_pre_rebase= ;; - --continue|--skip|--abort) + --continue|--skip|--abort|--edit-todo) test $total_argc -eq 2 || usage action=${1##--} ;; @@@ -307,11 -306,6 +307,11 @@@ the fi fi +if test "$action" = "edit-todo" && test "$type" != "interactive" +then + die "$(gettext "The --edit-todo action can only be used during interactive rebase.")" +fi + case "$action" in continue) # Sanity check @@@ -344,9 -338,6 +344,9 @@@ abort rm -r "$state_dir" exit ;; +edit-todo) + run_specific_rebase + ;; esac # Make sure no rebase is in progress @@@ -473,7 -464,7 +473,7 @@@ case "$#" i head_name="detached HEAD" branch_name=HEAD ;# detached fi - orig_head=$(git rev-parse --verify "${branch_name}^0") || exit + orig_head=$(git rev-parse --verify HEAD) || exit ;; *) die "BUG: unexpected number of arguments left to parse" diff --combined t/t3400-rebase.sh index f6cc102657,e6af021c10..b58fa1a232 --- a/t/t3400-rebase.sh +++ b/t/t3400-rebase.sh @@@ -101,7 -101,14 +101,14 @@@ test_expect_success 'HEAD was detached test $(git rev-parse HEAD@{1}) != $(git rev-parse my-topic-branch@{1}) ' + test_expect_success 'rebase from ambiguous branch name' ' + git checkout -b topic side && + git rebase master + ' + test_expect_success 'rebase after merge master' ' + git checkout --detach refs/tags/topic && + git branch -D topic && git reset --hard topic && git merge master && git rebase master && @@@ -138,7 -145,8 +145,7 @@@ test_expect_success 'rebase a single mo ' test_expect_success 'rebase is not broken by diff.renames' ' - git config diff.renames copies && - test_when_finished "git config --unset diff.renames" && + test_config diff.renames copies && git checkout filemove && GIT_TRACE=1 git rebase force-3way '