{"thread":{"id":"14052","subject":"[PATCH 1/3] t3404: slight improvements","startedAt":"2008-06-20T02:45:32Z","lastAt":"2008-06-21T23:55:51Z","messageCount":21,"participants":["Stephan Beyer","Johannes Sixt","Johannes Schindelin","Brandon Casey","しらいしななこ","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"80428","messageId":"1213929935-15093-1-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":null,"subject":"some small changes for rebase-i","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T02:45:32Z","receivedAt":"2008-06-20T02:45:32Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nthe following small patchset can be applied to \"pu\" (i.e. to\njs/rebase-i-sequencer, which has been in \"next\" before it\nhas been rewound.)\n\nThe first adds some tests that seemed useful to me during early\nsequencer prototype development,\nthe second is just one for the look and\nthe third makes rebase-i use OPTIONS_SPEC.\n\nRegards,\n  Stephan\n"},{"id":"80427","messageId":"1213929935-15093-2-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":"1213929935-15093-1-git-send-email-s-beyer@gmx.net","subject":"[PATCH 1/3] t3404: slight improvements","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T02:45:33Z","receivedAt":"2008-06-20T02:45:33Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"This patch adds some extra checks into some\ntest cases and changes \"! git ...\" into\n\"test_must_fail git\".\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n t/t3404-rebase-interactive.sh |   29 +++++++++++++++++++----------\n 1 files changed, 19 insertions(+), 10 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex e6f3fad..daba5fd 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -107,7 +107,8 @@ chmod a+x fake-editor.sh\n \n test_expect_success 'no changes are a nop' '\n \tgit rebase -i F &&\n-\ttest $(git rev-parse I) = $(git rev-parse HEAD)\n+\ttest $(git rev-parse I) = $(git rev-parse HEAD) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch2\"\n '\n \n test_expect_success 'test the [branch] option' '\n@@ -115,7 +116,9 @@ test_expect_success 'test the [branch] option' '\n \tgit rm file6 &&\n \tgit commit -m \"stop here\" &&\n \tgit rebase -i F branch2 &&\n-\ttest $(git rev-parse I) = $(git rev-parse HEAD)\n+\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n+\ttest $(git rev-parse I) = $(git rev-parse HEAD) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch2\"\n '\n \n test_expect_success 'rebase on top of a non-conflicting commit' '\n@@ -123,7 +126,9 @@ test_expect_success 'rebase on top of a non-conflicting commit' '\n \tgit tag original-branch1 &&\n \tgit rebase -i branch2 &&\n \ttest file6 = $(git diff --name-only original-branch1) &&\n-\ttest $(git rev-parse I) = $(git rev-parse HEAD~2)\n+\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n+\ttest $(git rev-parse I) = $(git rev-parse HEAD~2) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\"\n '\n \n test_expect_success 'reflog for the branch shows state before rebase' '\n@@ -155,9 +160,12 @@ EOF\n \n test_expect_success 'stop on conflicting pick' '\n \tgit tag new-branch1 &&\n-\t! git rebase -i master &&\n+\ttest_must_fail git rebase -i master &&\n+\ttest \"$(git rev-parse HEAD~3)\" = \"$(git rev-parse master)\" &&\n \ttest_cmp expect .git/.dotest-merge/patch &&\n \ttest_cmp expect2 file1 &&\n+\ttest \"$(git-diff --name-status |\n+\t\tsed -n -e \"/^U/s/^U[^a-z]*//p\")\" = file1 &&\n \ttest 4 = $(grep -v \"^#\" < .git/.dotest-merge/done | wc -l) &&\n \ttest 0 = $(grep -c \"^[^#]\" < .git/.dotest-merge/git-rebase-todo)\n '\n@@ -165,6 +173,7 @@ test_expect_success 'stop on conflicting pick' '\n test_expect_success 'abort' '\n \tgit rebase --abort &&\n \ttest $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\" &&\n \t! test -d .git/.dotest-merge\n '\n \n@@ -331,7 +340,7 @@ test_expect_success 'interactive -t preserves tags' '\n test_expect_success '--continue tries to commit' '\n \tgit checkout to-be-rebased &&\n \ttest_tick &&\n-\t! git rebase -i --onto new-branch1 HEAD^ &&\n+\ttest_must_fail git rebase -i --onto new-branch1 HEAD^ &&\n \techo resolved > file1 &&\n \tgit add file1 &&\n \tFAKE_COMMIT_MESSAGE=\"chouette!\" git rebase --continue &&\n@@ -342,7 +351,7 @@ test_expect_success '--continue tries to commit' '\n test_expect_success 'verbose flag is heeded, even after --continue' '\n \tgit reset --hard HEAD@{1} &&\n \ttest_tick &&\n-\t! git rebase -v -i --onto new-branch1 HEAD^ &&\n+\ttest_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&\n \techo resolved > file1 &&\n \tgit add file1 &&\n \tgit rebase --continue > output &&\n@@ -380,7 +389,7 @@ test_expect_success 'interrupted squash works as expected' '\n \t! FAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n \t(echo one; echo two; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \techo resolved > conflict &&\n \tgit add conflict &&\n \tgit rebase --continue &&\n@@ -398,10 +407,10 @@ test_expect_success 'interrupted squash works as expected (case 2)' '\n \t! FAKE_LINES=\"3 squash 1 2\" git rebase -i HEAD~3 &&\n \t(echo one; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \t(echo one; echo two; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \techo resolved > conflict &&\n \tgit add conflict &&\n \tgit rebase --continue &&\n@@ -449,7 +458,7 @@ test_expect_success 'rebase a commit violating pre-commit' '\n \tchmod a+x $PRE_COMMIT &&\n \techo \"monde! \" >> file1 &&\n \ttest_tick &&\n-\t! git commit -m doesnt-verify file1 &&\n+\ttest_must_fail git commit -m doesnt-verify file1 &&\n \tgit commit -m doesnt-verify --no-verify file1 &&\n \ttest_tick &&\n \tFAKE_LINES=2 git rebase -i HEAD~2\n-- \n1.5.5.1.561.gd8556\n"},{"id":"80430","messageId":"1213929935-15093-3-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":"1213929935-15093-2-git-send-email-s-beyer@gmx.net","subject":"[PATCH 2/3] rebase-i: slight internal improvements","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T02:45:34Z","receivedAt":"2008-06-20T02:45:34Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Add commit_message function to get the commit message\nfrom a commit and other slight internal improvements.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n git-rebase--interactive.sh |   61 +++++++++++++++++++++++++------------------\n 1 files changed, 35 insertions(+), 26 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 3f926d8..e8ac2ae 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -25,6 +25,7 @@ SQUASH_MSG=\"$DOTEST\"/message-squash\n PRESERVE_MERGES=\n STRATEGY=\n VERBOSE=\n+MARK_PREFIX='refs/rebase-marks'\n test -f \"$DOTEST\"/strategy && STRATEGY=\"$(cat \"$DOTEST\"/strategy)\"\n test -f \"$DOTEST\"/verbose && VERBOSE=t\n \n@@ -33,7 +34,6 @@ mark the corrected paths with 'git add <paths>', and\n run 'git rebase --continue'\"\n export GIT_CHERRY_PICK_HELP\n \n-mark_prefix=refs/rebase-marks/\n \n warn () {\n \techo \"$*\" >&2\n@@ -73,13 +73,18 @@ comment_for_reflog () {\n \tesac\n }\n \n+# Get commit message from commit $1\n+commit_message () {\n+\tgit cat-file commit \"$1\" | sed -e '1,/^$/d'\n+}\n+\n last_count=\n mark_action_done () {\n-\tsed -e 1q < \"$TODO\" >> \"$DONE\"\n-\tsed -e 1d < \"$TODO\" >> \"$TODO\".new\n-\tmv -f \"$TODO\".new \"$TODO\"\n-\tcount=$(grep -c '^[^#]' < \"$DONE\")\n-\ttotal=$(($count+$(grep -c '^[^#]' < \"$TODO\")))\n+\tsed -e 1q \"$TODO\" >>\"$DONE\"\n+\tsed -e 1d \"$TODO\" >>\"$TODO.new\"\n+\tmv -f \"$TODO.new\" \"$TODO\"\n+\tcount=\"$(grep -c '^[^#]' \"$DONE\")\"\n+\ttotal=\"$(expr \"$count\" + \"$(grep -c '^[^#]' \"$TODO\")\")\"\n \tif test \"$last_count\" != \"$count\"\n \tthen\n \t\tlast_count=$count\n@@ -88,16 +93,18 @@ mark_action_done () {\n \tfi\n }\n \n+# Generate message, patch and author script files\n make_patch () {\n \tparent_sha1=$(git rev-parse --verify \"$1\"^) ||\n \t\tdie \"Cannot get patch for $1^\"\n \tgit diff-tree -p \"$parent_sha1\"..\"$1\" > \"$DOTEST\"/patch\n \ttest -f \"$DOTEST\"/message ||\n-\t\tgit cat-file commit \"$1\" | sed \"1,/^$/d\" > \"$DOTEST\"/message\n+\t\tcommit_message \"$1\" >\"$DOTEST\"/message\n \ttest -f \"$DOTEST\"/author-script ||\n \t\tget_author_ident_from_commit \"$1\" > \"$DOTEST\"/author-script\n }\n \n+# Generate a patch and die\n die_with_patch () {\n \tmake_patch \"$1\"\n \tgit rerere\n@@ -105,9 +112,9 @@ die_with_patch () {\n }\n \n cleanup_before_quit () {\n-\tfor ref in $(git for-each-ref --format='%(refname)' \"${mark_prefix%/}\")\n+\tfor ref in $(git for-each-ref --format='%(refname)' \"$MARK_PREFIX\")\n \tdo\n-\t\tgit update-ref -d \"$ref\" \"$ref\" || return 1\n+\t\tgit update-ref -d \"$ref\" \"$ref\" || return\n \tdone\n \trm -rf \"$DOTEST\"\n }\n@@ -118,7 +125,7 @@ die_abort () {\n }\n \n has_action () {\n-\tgrep '^[^#]' \"$1\" >/dev/null\n+\tgrep -q '^[^#]' \"$1\"\n }\n \n redo_merge () {\n@@ -126,7 +133,7 @@ redo_merge () {\n \tshift\n \n \teval \"$(get_author_ident_from_commit $rm_sha1)\"\n-\tmsg=\"$(git cat-file commit $rm_sha1 | sed -e '1,/^$/d')\"\n+\tmsg=\"$(commit_message \"$rm_sha1\")\"\n \n \tif ! GIT_AUTHOR_NAME=\"$GIT_AUTHOR_NAME\" \\\n \t\tGIT_AUTHOR_EMAIL=\"$GIT_AUTHOR_EMAIL\" \\\n@@ -167,37 +174,39 @@ nth_string () {\n }\n \n make_squash_message () {\n-\tif test -f \"$SQUASH_MSG\"; then\n-\t\tCOUNT=$(($(sed -n \"s/^# This is [^0-9]*\\([1-9][0-9]*\\).*/\\1/p\" \\\n-\t\t\t< \"$SQUASH_MSG\" | sed -ne '$p')+1))\n+\tif test -f \"$SQUASH_MSG\"\n+\tthen\n+\t\tcount=\"$(($(sed -n -e 's/^# This is [^0-9]*\\([1-9][0-9]*\\).*/\\1/p' \\\n+\t\t\t\"$SQUASH_MSG\" | sed -n -e '$p')+1))\"\n \t\techo \"# This is a combination of $COUNT commits.\"\n \t\tsed -e 1d -e '2,/^./{\n \t\t\t/^$/d\n-\t\t}' <\"$SQUASH_MSG\"\n+\t\t}' \"$SQUASH_MSG\"\n \telse\n \t\tCOUNT=2\n \t\techo \"# This is a combination of two commits.\"\n \t\techo \"# The first commit's message is:\"\n \t\techo\n-\t\tgit cat-file commit HEAD | sed -e '1,/^$/d'\n+\t\tcommit_message HEAD\n \tfi\n \techo\n \techo \"# This is the $(nth_string $COUNT) commit message:\"\n \techo\n-\tgit cat-file commit $1 | sed -e '1,/^$/d'\n+\tcommit_message \"$1\"\n }\n \n peek_next_command () {\n-\tsed -n \"1s/ .*$//p\" < \"$TODO\"\n+\tsed -n -e '1s/ .*$//p' \"$TODO\"\n }\n \n+# If $1 is a mark, make a ref from it; otherwise keep it\n mark_to_ref () {\n-\tif expr \"$1\" : \"^:[0-9][0-9]*$\" >/dev/null\n-\tthen\n-\t\techo \"$mark_prefix$(printf %d ${1#:})\"\n-\telse\n-\t\techo \"$1\"\n-\tfi\n+\targ=\"$1\"\n+\tref=\"$(expr \"$arg\" : '^:0*\\([0-9]\\+\\)$')\"\n+\ttest -n \"$ref\" &&\n+\t\targ=\"$MARK_PREFIX/$ref\"\n+\tprintf '%s\\n' \"$arg\"\n+\tunset arg ref\n }\n \n do_next () {\n@@ -634,7 +643,7 @@ do\n \t\tUPSTREAM=$(git rev-parse --verify \"$1\") || die \"Invalid base\"\n \t\ttest -z \"$ONTO\" && ONTO=$UPSTREAM\n \n-\t\tif test ! -z \"$2\"\n+\t\tif test -n \"$2\"\n \t\tthen\n \t\t\toutput git show-ref --verify --quiet \"refs/heads/$2\" ||\n \t\t\t\tdie \"Invalid branchname: $2\"\n@@ -674,7 +683,7 @@ do\n \t\t\t\tcreate_extended_todo_list\n \t\telse\n \t\t\tgit rev-list --no-merges --reverse --pretty=oneline \\\n-\t\t\t\t $common_rev_list_opts | sed -n \"s/^>/pick /p\"\n+\t\t\t\t $common_rev_list_opts | sed -n -e 's/^>/pick /p'\n \t\tfi > \"$TODO\"\n \n \t\tcat >> \"$TODO\" << EOF\n-- \n1.5.5.1.561.gd8556\n"},{"id":"80429","messageId":"1213929935-15093-4-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":"1213929935-15093-3-git-send-email-s-beyer@gmx.net","subject":"[PATCH 3/3] Make rebase--interactive use OPTIONS_SPEC","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T02:45:35Z","receivedAt":"2008-06-20T02:45:35Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Signed-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\n git-rebase--interactive.sh |   58 ++++++++++++++++++++++++++-----------------\n 1 files changed, 35 insertions(+), 23 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex e8ac2ae..aeb9628 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -10,10 +10,25 @@\n # The original idea comes from Eric W. Biederman, in\n # http://article.gmane.org/gmane.comp.version-control.git/22407\n \n-USAGE='(--continue | --abort | --skip | [--preserve-merges] [--first-parent]\n-\t[--preserve-tags] [--verbose] [--onto <branch>] <upstream> [<branch>])'\n+OPTIONS_KEEPDASHDASH=\n+OPTIONS_SPEC='\n+git-rebase -i [options] <upstream> [<branch>]\n+git-rebase (--continue | --abort | --skip)\n+--\n+continue           Continue rebasing process\n+abort              Abort rebasing process and restore original branch\n+skip               Skip current patch and continue rebasing process\n+p,preserve-merges  Try to recreate merges instead of ignoring\n+t,preserve-tags    Update tags to the new commit object\n+m,merge            Used anyways (no-op)\n+i,interactive      Used anyways (no-op)\n+onto=              Rebase onto given branch instead of upstream\n+v,verbose          Display a diffstat of what changed upstream\n+ When preserving merges:\n+f,first-parent     Show only commits following the first parent of each commit\n+s,strategy=        Use the given merge strategy\n+'\n \n-OPTIONS_SPEC=\n . git-sh-setup\n require_work_tree\n \n@@ -25,6 +40,7 @@ SQUASH_MSG=\"$DOTEST\"/message-squash\n PRESERVE_MERGES=\n STRATEGY=\n VERBOSE=\n+ONTO=\n MARK_PREFIX='refs/rebase-marks'\n test -f \"$DOTEST\"/strategy && STRATEGY=\"$(cat \"$DOTEST\"/strategy)\"\n test -f \"$DOTEST\"/verbose && VERBOSE=t\n@@ -584,7 +600,7 @@ do\n \n \t\toutput git reset --hard && do_rest\n \t\t;;\n-\t-s|--strategy)\n+\t-s)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n \t\t\tSTRATEGY=\"-s \"$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)') ;;\n@@ -595,32 +611,36 @@ do\n \t\t\tshift ;;\n \t\tesac\n \t\t;;\n-\t-m|--merge)\n+\t-m)\n \t\t# we use merge anyway\n \t\t;;\n-\t-C*)\n-\t\tdie \"Interactive rebase uses merge, so $1 does not make sense\"\n-\t\t;;\n-\t-v|--verbose)\n+\t-v)\n \t\tVERBOSE=t\n \t\t;;\n-\t-p|--preserve-merges)\n+\t-p)\n \t\tPRESERVE_MERGES=t\n \t\t;;\n-\t-f|--first-parent)\n+\t-f)\n \t\tFIRST_PARENT=t\n \t\tPRESERVE_MERGES=t\n \t\t;;\n-\t-t|--preserve-tags)\n+\t-t)\n \t\tPRESERVE_TAGS=t\n \t\t;;\n-\t-i|--interactive)\n+\t-i)\n \t\t# yeah, we know\n \t\t;;\n+\t--onto)\n+\t\tshift\n+\t\tONTO=$(git rev-parse --verify \"$1\") ||\n+\t\t\tdie \"Does not point to a valid commit: $1\"\n+\t\t;;\n \t''|-h)\n \t\tusage\n \t\t;;\n-\t*)\n+\t--)\n+\t\tshift\n+\t\ttest $# -eq 1 -o $# -eq 2 || usage\n \t\ttest -d \"$DOTEST\" &&\n \t\t\tdie \"Interactive rebase already started\"\n \n@@ -629,15 +649,6 @@ do\n \n \t\tcomment_for_reflog start\n \n-\t\tONTO=\n-\t\tcase \"$1\" in\n-\t\t--onto)\n-\t\t\tONTO=$(git rev-parse --verify \"$2\") ||\n-\t\t\t\tdie \"Does not point to a valid commit: $2\"\n-\t\t\tshift; shift\n-\t\t\t;;\n-\t\tesac\n-\n \t\trequire_clean_work_tree\n \n \t\tUPSTREAM=$(git rev-parse --verify \"$1\") || die \"Invalid base\"\n@@ -720,6 +731,7 @@ EOF\n \t\t\tdie_abort \"Nothing to do\"\n \n \t\toutput git checkout $ONTO && do_rest\n+\t\texit 0\n \t\t;;\n \tesac\n \tshift\n-- \n1.5.5.1.561.gd8556\n"},{"id":"80436","messageId":"20080620054810.GB7369@leksak.fem-net","threadId":"14052","inReplyTo":"1213929935-15093-4-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH 3/3] Make rebase--interactive use OPTIONS_SPEC","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T05:48:10Z","receivedAt":"2008-06-20T05:48:10Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Ouch, here is a little mistake:\n> +OPTIONS_SPEC='\n> +git-rebase -i [options] <upstream> [<branch>]\n\nMust be:\n\tOPTIONS_SPEC='git-rebase -i [options] <upstream> [<branch>]\n...or the usage string will be empty.\n\nAre there other reasons for a v2?\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"80439","messageId":"485B595B.80608@viscovery.net","threadId":"14052","inReplyTo":"1213929935-15093-3-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH 2/3] rebase-i: slight internal improvements","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-06-20T07:16:43Z","receivedAt":"2008-06-20T07:16:43Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Stephan Beyer schrieb:\n> Add commit_message function to get the commit message\n> from a commit and other slight internal improvements.\n\nIf by \"other slight improvements\" you mean ...\n\n>  mark_action_done () {\n> -\tsed -e 1q < \"$TODO\" >> \"$DONE\"\n> -\tsed -e 1d < \"$TODO\" >> \"$TODO\".new\n> -\tmv -f \"$TODO\".new \"$TODO\"\n> -\tcount=$(grep -c '^[^#]' < \"$DONE\")\n> -\ttotal=$(($count+$(grep -c '^[^#]' < \"$TODO\")))\n> +\tsed -e 1q \"$TODO\" >>\"$DONE\"\n> +\tsed -e 1d \"$TODO\" >>\"$TODO.new\"\n> +\tmv -f \"$TODO.new\" \"$TODO\"\n> +\tcount=\"$(grep -c '^[^#]' \"$DONE\")\"\n> +\ttotal=\"$(expr \"$count\" + \"$(grep -c '^[^#]' \"$TODO\")\")\"\n\n... this ...\n\n>  has_action () {\n> -\tgrep '^[^#]' \"$1\" >/dev/null\n> +\tgrep -q '^[^#]' \"$1\"\n\n... and this, etc, then they are not improvements. They make the script\nless portable: There are 'grep's that don't have -q, others write the file\nname in front of the count, and I _think_ I have encountered 'sed's that\ndon't take a file name as argument.\n\nThis patch is just code churn for which you give no convincing reason in\nthe commit message why it is good.\n\n-- Hannes\n"},{"id":"80443","messageId":"20080620080153.GC7369@leksak.fem-net","threadId":"14052","inReplyTo":"485B595B.80608@viscovery.net","subject":"Re: [PATCH 2/3] rebase-i: slight internal improvements","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T08:01:53Z","receivedAt":"2008-06-20T08:01:53Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nOn Fri, Jun 20, 2008 at 09:16:43AM +0200, Johannes Sixt wrote:\n> If by \"other slight improvements\" you mean ...\n> \n> >  mark_action_done () {\n> > -\tsed -e 1q < \"$TODO\" >> \"$DONE\"\n> > -\tsed -e 1d < \"$TODO\" >> \"$TODO\".new\n> > -\tmv -f \"$TODO\".new \"$TODO\"\n> > -\tcount=$(grep -c '^[^#]' < \"$DONE\")\n> > -\ttotal=$(($count+$(grep -c '^[^#]' < \"$TODO\")))\n> > +\tsed -e 1q \"$TODO\" >>\"$DONE\"\n> > +\tsed -e 1d \"$TODO\" >>\"$TODO.new\"\n> > +\tmv -f \"$TODO.new\" \"$TODO\"\n> > +\tcount=\"$(grep -c '^[^#]' \"$DONE\")\"\n> > +\ttotal=\"$(expr \"$count\" + \"$(grep -c '^[^#]' \"$TODO\")\")\"\n> \n> ... this ...\n> \n> >  has_action () {\n> > -\tgrep '^[^#]' \"$1\" >/dev/null\n> > +\tgrep -q '^[^#]' \"$1\"\n> \n> ... and this, etc, then they are not improvements. They make the script\n> less portable:\n\nOk, great to know.\n\n> There are 'grep's that don't have -q,\n\nWell, it's always a little hard to say what is understood by most of the\nimplementations.  POSIX says, there is grep -q and a few git test\nscripts and the Makefile uses it, too.\n\nOk, so I've looked for a list \"the least common denominator of shell\ncommands you can use to be portable\" on the net and found the \nGNU Autoconf documentation:\nhttp://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_node/autoconf_123.html\nLooks like *portable* shell programming is no fun :\\\n\n> others write the file name in front of the count,\n\nI did not really change anything that's related to the count, btw.\n\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"80445","messageId":"485B678D.3090800@viscovery.net","threadId":"14052","inReplyTo":"20080620080153.GC7369@leksak.fem-net","subject":"Re: [PATCH 2/3] rebase-i: slight internal improvements","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2008-06-20T08:17:17Z","receivedAt":"2008-06-20T08:17:17Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Stephan Beyer schrieb:\n> Looks like *portable* shell programming is no fun :\\\n\n> On Fri, Jun 20, 2008 at 09:16:43AM +0200, Johannes Sixt wrote:\n>> others write the file name in front of the count,\n> \n> I did not really change anything that's related to the count, btw.\n\nYou changed:\n\n-\tcount=$(grep -c '^[^#]' < \"$DONE\")\n+\tcount=\"$(grep -c '^[^#]' \"$DONE\")\"\n\nIt turns out that GNU grep and AIX 4.3's grep don't write the file name if\nonly one name was given. Nevertheless, by passing the data on stdin we are\non the safe side. And, btw, the outer quotes are not needed in this\nassignment.\n\n-- Hannes\n"},{"id":"80471","messageId":"alpine.DEB.1.00.0806201344180.6439@racer","threadId":"14052","inReplyTo":"20080620080153.GC7369@leksak.fem-net","subject":"Re: [PATCH 2/3] rebase-i: slight internal improvements","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-20T12:46:29Z","receivedAt":"2008-06-20T12:46:29Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 20 Jun 2008, Stephan Beyer wrote:\n\n> Looks like *portable* shell programming is no fun :\\\n\nThat is right.  That's one of the reasons why I prefer moving scripts to \nbuiltins: prototyping is good and well, but when you need to put it into \nproduction, where people have all kinds of weird setups (just think of \ndash in Ubuntu!), it is no fun.\n\nBetter to use something portable, such as C.\n\nWhich is the whole point of your project, right?  You want to turn the \nreal engine into a builtin.\n\nSo would you not agree that PATCH 2/3 is rather unnecessary?\n\nCiao,\nDscho\n"},{"id":"80480","messageId":"alpine.DEB.1.00.0806201404020.6439@racer","threadId":"14052","inReplyTo":"1213929935-15093-2-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH 1/3] t3404: slight improvements","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-20T13:05:30Z","receivedAt":"2008-06-20T13:05:30Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Fri, 20 Jun 2008, Stephan Beyer wrote:\n\n> This patch adds some extra checks into some\n> test cases and changes \"! git ...\" into\n> \"test_must_fail git\".\n\nI think your oneline should read \"t3404: be more anal\".\n\n> diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\n> index e6f3fad..daba5fd 100755\n> --- a/t/t3404-rebase-interactive.sh\n> +++ b/t/t3404-rebase-interactive.sh\n> @@ -107,7 +107,8 @@ chmod a+x fake-editor.sh\n>  \n>  test_expect_success 'no changes are a nop' '\n>  \tgit rebase -i F &&\n> -\ttest $(git rev-parse I) = $(git rev-parse HEAD)\n> +\ttest $(git rev-parse I) = $(git rev-parse HEAD) &&\n> +\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch2\"\n>  '\n\nYou could have saved some diff-screen-estate by putting the extra check \n_before_ the original one.\n\nOther than that, I think this patch is fine.\n\nCiao,\nDscho\n"},{"id":"80482","messageId":"alpine.DEB.1.00.0806201407230.6439@racer","threadId":"14052","inReplyTo":"1213929935-15093-4-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH 3/3] Make rebase--interactive use OPTIONS_SPEC","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-06-20T13:15:38Z","receivedAt":"2008-06-20T13:15:38Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nI like the patch.  Just a couple comments:\n\nOn Fri, 20 Jun 2008, Stephan Beyer wrote:\n\n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> index e8ac2ae..aeb9628 100755\n> --- a/git-rebase--interactive.sh\n> +++ b/git-rebase--interactive.sh\n> @@ -10,10 +10,25 @@\n>  # The original idea comes from Eric W. Biederman, in\n>  # http://article.gmane.org/gmane.comp.version-control.git/22407\n>  \n> -USAGE='(--continue | --abort | --skip | [--preserve-merges] [--first-parent]\n> -\t[--preserve-tags] [--verbose] [--onto <branch>] <upstream> [<branch>])'\n> +OPTIONS_KEEPDASHDASH=\n> +OPTIONS_SPEC='\n> +git-rebase -i [options] <upstream> [<branch>]\n> +git-rebase (--continue | --abort | --skip)\n\nHere, \"-i\" is not an error, but not required either, so it should be\n\n+git-rebase [-i] (--continue | --abort | --skip)\n\n> +--\n> +continue           Continue rebasing process\n> +abort              Abort rebasing process and restore original branch\n> +skip               Skip current patch and continue rebasing process\n\nI wonder if these options (which really should be subcommands) should not \ngo below the options, for chronological reasons: you are likely to need \nthe other options before --continue and friends.\n\n> +p,preserve-merges  Try to recreate merges instead of ignoring\n\ns/$/ them/\n\n> +t,preserve-tags    Update tags to the new commit object\n> +m,merge            Used anyways (no-op)\n> +i,interactive      Used anyways (no-op)\n\ns/anyways/always/\n\nHmm?\n\n> +onto=              Rebase onto given branch instead of upstream\n> +v,verbose          Display a diffstat of what changed upstream\n> + When preserving merges:\n> +f,first-parent     Show only commits following the first parent of each commit\n> +s,strategy=        Use the given merge strategy\n> +'\n>  \n> -OPTIONS_SPEC=\n>  . git-sh-setup\n>  require_work_tree\n>  \n> @@ -595,32 +611,36 @@ do\n>\n> [...]\n>\n> +\t--onto)\n> +\t\tshift\n> +\t\tONTO=$(git rev-parse --verify \"$1\") ||\n> +\t\t\tdie \"Does not point to a valid commit: $1\"\n> +\t\t;;\n\nYou probably need to introduce checks against \"git rebase --continue \n--onto blabla\", then.\n\n>  \t''|-h)\n>  \t\tusage\n>  \t\t;;\n> -\t*)\n> +\t--)\n> +\t\tshift\n> +\t\ttest $# -eq 1 -o $# -eq 2 || usage\n\nI consider this a bugfix.  Thanks.\n\n> @@ -720,6 +731,7 @@ EOF\n>  \t\t\tdie_abort \"Nothing to do\"\n>  \n>  \t\toutput git checkout $ONTO && do_rest\n> +\t\texit 0\n>  \t\t;;\n>  \tesac\n>  \tshift\n\nThis exit is not really necessary, is it?  Besides, a simple \"exit\" would \nbe more correct: it reuses the exit status of the most recently executed \ncommand, which is what we want here.\n\nThanks,\nDscho\n"},{"id":"80509","messageId":"1213986614-19536-1-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":"alpine.DEB.1.00.0806201407230.6439@racer","subject":"[PATCH 1/2] t3404: extra checks and s/! git/test_must_fail git/","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T18:30:13Z","receivedAt":"2008-06-20T18:30:13Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"This patch adds some extra checks (especially branch checks)\ntest cases and changes \"! git ...\" into \"test_must_fail git\".\n\nAlso a --onto test case is added.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\nDscho,\n\nas you've comman^Wwished ;-)\n(except the analism)\n\nNote that I've also added a --onto test.\n\n t/t3404-rebase-interactive.sh |   31 ++++++++++++++++++++++++-------\n 1 files changed, 24 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex e6f3fad..96985ff 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -107,6 +107,7 @@ chmod a+x fake-editor.sh\n \n test_expect_success 'no changes are a nop' '\n \tgit rebase -i F &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch2\" &&\n \ttest $(git rev-parse I) = $(git rev-parse HEAD)\n '\n \n@@ -115,14 +116,26 @@ test_expect_success 'test the [branch] option' '\n \tgit rm file6 &&\n \tgit commit -m \"stop here\" &&\n \tgit rebase -i F branch2 &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch2\" &&\n+\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n \ttest $(git rev-parse I) = $(git rev-parse HEAD)\n '\n \n+test_expect_success 'test --onto <branch>' '\n+\tgit checkout -b test-onto branch2 &&\n+\tgit rebase -i --onto branch1 F &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/test-onto\" &&\n+\ttest $(git rev-parse HEAD^) = $(git rev-parse branch1) &&\n+\ttest $(git rev-parse I) = $(git rev-parse branch2)\n+'\n+\n test_expect_success 'rebase on top of a non-conflicting commit' '\n \tgit checkout branch1 &&\n \tgit tag original-branch1 &&\n \tgit rebase -i branch2 &&\n \ttest file6 = $(git diff --name-only original-branch1) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\" &&\n+\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n \ttest $(git rev-parse I) = $(git rev-parse HEAD~2)\n '\n \n@@ -155,9 +168,12 @@ EOF\n \n test_expect_success 'stop on conflicting pick' '\n \tgit tag new-branch1 &&\n-\t! git rebase -i master &&\n+\ttest_must_fail git rebase -i master &&\n+\ttest \"$(git rev-parse HEAD~3)\" = \"$(git rev-parse master)\" &&\n \ttest_cmp expect .git/.dotest-merge/patch &&\n \ttest_cmp expect2 file1 &&\n+\ttest \"$(git-diff --name-status |\n+\t\tsed -n -e \"/^U/s/^U[^a-z]*//p\")\" = file1 &&\n \ttest 4 = $(grep -v \"^#\" < .git/.dotest-merge/done | wc -l) &&\n \ttest 0 = $(grep -c \"^[^#]\" < .git/.dotest-merge/git-rebase-todo)\n '\n@@ -165,6 +181,7 @@ test_expect_success 'stop on conflicting pick' '\n test_expect_success 'abort' '\n \tgit rebase --abort &&\n \ttest $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\" &&\n \t! test -d .git/.dotest-merge\n '\n \n@@ -331,7 +348,7 @@ test_expect_success 'interactive -t preserves tags' '\n test_expect_success '--continue tries to commit' '\n \tgit checkout to-be-rebased &&\n \ttest_tick &&\n-\t! git rebase -i --onto new-branch1 HEAD^ &&\n+\ttest_must_fail git rebase -i --onto new-branch1 HEAD^ &&\n \techo resolved > file1 &&\n \tgit add file1 &&\n \tFAKE_COMMIT_MESSAGE=\"chouette!\" git rebase --continue &&\n@@ -342,7 +359,7 @@ test_expect_success '--continue tries to commit' '\n test_expect_success 'verbose flag is heeded, even after --continue' '\n \tgit reset --hard HEAD@{1} &&\n \ttest_tick &&\n-\t! git rebase -v -i --onto new-branch1 HEAD^ &&\n+\ttest_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&\n \techo resolved > file1 &&\n \tgit add file1 &&\n \tgit rebase --continue > output &&\n@@ -380,7 +397,7 @@ test_expect_success 'interrupted squash works as expected' '\n \t! FAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n \t(echo one; echo two; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \techo resolved > conflict &&\n \tgit add conflict &&\n \tgit rebase --continue &&\n@@ -398,10 +415,10 @@ test_expect_success 'interrupted squash works as expected (case 2)' '\n \t! FAKE_LINES=\"3 squash 1 2\" git rebase -i HEAD~3 &&\n \t(echo one; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \t(echo one; echo two; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \techo resolved > conflict &&\n \tgit add conflict &&\n \tgit rebase --continue &&\n@@ -449,7 +466,7 @@ test_expect_success 'rebase a commit violating pre-commit' '\n \tchmod a+x $PRE_COMMIT &&\n \techo \"monde! \" >> file1 &&\n \ttest_tick &&\n-\t! git commit -m doesnt-verify file1 &&\n+\ttest_must_fail git commit -m doesnt-verify file1 &&\n \tgit commit -m doesnt-verify --no-verify file1 &&\n \ttest_tick &&\n \tFAKE_LINES=2 git rebase -i HEAD~2\n-- \n1.5.6.167.g86f2\n"},{"id":"80510","messageId":"1213986614-19536-2-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":"1213986614-19536-1-git-send-email-s-beyer@gmx.net","subject":"[PATCH 2/2] Make rebase--interactive use OPTIONS_SPEC","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T18:30:14Z","receivedAt":"2008-06-20T18:30:14Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Also add some checks that --continue/--abort/--skip\nactions are used without --onto, -p, -t, etc.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\nHi,\n\nDscho wrote:\n> You probably need to introduce checks against \"git rebase --continue\n> --onto blabla\", then.\n\nNow the is_standalone function does that.\n\nRegards,\n  Stephan\n\nPS: I wondered that nobody moaned that the patch is for pu.\n\n git-rebase--interactive.sh |   71 +++++++++++++++++++++++++++++--------------\n 1 files changed, 48 insertions(+), 23 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 3f926d8..1894c37 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -10,10 +10,27 @@\n # The original idea comes from Eric W. Biederman, in\n # http://article.gmane.org/gmane.comp.version-control.git/22407\n \n-USAGE='(--continue | --abort | --skip | [--preserve-merges] [--first-parent]\n-\t[--preserve-tags] [--verbose] [--onto <branch>] <upstream> [<branch>])'\n+OPTIONS_KEEPDASHDASH=\n+OPTIONS_SPEC=\"\\\n+git-rebase [-i] [options] [--] <upstream> [<branch>]\n+git-rebase [-i] (--continue | --abort | --skip)\n+--\n+ Available options are:\n+p,preserve-merges  Try to recreate merges instead of ignoring them\n+t,preserve-tags    Update tags to the new commit object\n+m,merge            Always used (no-op)\n+i,interactive      Always used (no-op)\n+onto=              Rebase onto given branch instead of upstream\n+v,verbose          Display a diffstat of what changed upstream\n+ When preserving merges:\n+f,first-parent     Show only commits following the first parent of each commit\n+s,strategy=        Use the given merge strategy\n+ Actions:\n+continue           Continue rebasing process\n+abort              Abort rebasing process and restore original branch\n+skip               Skip current patch and continue rebasing process\n+\"\n \n-OPTIONS_SPEC=\n . git-sh-setup\n require_work_tree\n \n@@ -25,6 +42,8 @@ SQUASH_MSG=\"$DOTEST\"/message-squash\n PRESERVE_MERGES=\n STRATEGY=\n VERBOSE=\n+ONTO=\n+MARK_PREFIX='refs/rebase-marks'\n test -f \"$DOTEST\"/strategy && STRATEGY=\"$(cat \"$DOTEST\"/strategy)\"\n test -f \"$DOTEST\"/verbose && VERBOSE=t\n \n@@ -515,10 +534,19 @@ create_extended_todo_list () {\n \tdone\n }\n \n+is_standalone () {\n+\ttest $# -eq 2 -a \"$2\" = '--' &&\n+\ttest -z \"$ONTO\" &&\n+\ttest -z \"$PRESERVE_TAGS\" &&\n+\ttest -z \"$PRESERVE_MERGES\" &&\n+\ttest -z \"$FIRST_PARENT\"\n+}\n+\n while test $# != 0\n do\n \tcase \"$1\" in\n \t--continue)\n+\t\tis_standalone \"$@\" || usage\n \t\tcomment_for_reflog continue\n \n \t\ttest -d \"$DOTEST\" || die \"No interactive rebase running\"\n@@ -551,6 +579,7 @@ do\n \t\tdo_rest\n \t\t;;\n \t--abort)\n+\t\tis_standalone \"$@\" || usage\n \t\tcomment_for_reflog abort\n \n \t\tgit rerere clear\n@@ -568,6 +597,7 @@ do\n \t\texit\n \t\t;;\n \t--skip)\n+\t\tis_standalone \"$@\" || usage\n \t\tcomment_for_reflog skip\n \n \t\tgit rerere clear\n@@ -575,7 +605,7 @@ do\n \n \t\toutput git reset --hard && do_rest\n \t\t;;\n-\t-s|--strategy)\n+\t-s)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n \t\t\tSTRATEGY=\"-s \"$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)') ;;\n@@ -586,32 +616,36 @@ do\n \t\t\tshift ;;\n \t\tesac\n \t\t;;\n-\t-m|--merge)\n+\t-m)\n \t\t# we use merge anyway\n \t\t;;\n-\t-C*)\n-\t\tdie \"Interactive rebase uses merge, so $1 does not make sense\"\n-\t\t;;\n-\t-v|--verbose)\n+\t-v)\n \t\tVERBOSE=t\n \t\t;;\n-\t-p|--preserve-merges)\n+\t-p)\n \t\tPRESERVE_MERGES=t\n \t\t;;\n-\t-f|--first-parent)\n+\t-f)\n \t\tFIRST_PARENT=t\n \t\tPRESERVE_MERGES=t\n \t\t;;\n-\t-t|--preserve-tags)\n+\t-t)\n \t\tPRESERVE_TAGS=t\n \t\t;;\n-\t-i|--interactive)\n+\t-i)\n \t\t# yeah, we know\n \t\t;;\n+\t--onto)\n+\t\tshift\n+\t\tONTO=$(git rev-parse --verify \"$1\") ||\n+\t\t\tdie \"Does not point to a valid commit: $1\"\n+\t\t;;\n \t''|-h)\n \t\tusage\n \t\t;;\n-\t*)\n+\t--)\n+\t\tshift\n+\t\ttest $# -eq 1 -o $# -eq 2 || usage\n \t\ttest -d \"$DOTEST\" &&\n \t\t\tdie \"Interactive rebase already started\"\n \n@@ -620,15 +654,6 @@ do\n \n \t\tcomment_for_reflog start\n \n-\t\tONTO=\n-\t\tcase \"$1\" in\n-\t\t--onto)\n-\t\t\tONTO=$(git rev-parse --verify \"$2\") ||\n-\t\t\t\tdie \"Does not point to a valid commit: $2\"\n-\t\t\tshift; shift\n-\t\t\t;;\n-\t\tesac\n-\n \t\trequire_clean_work_tree\n \n \t\tUPSTREAM=$(git rev-parse --verify \"$1\") || die \"Invalid base\"\n-- \n1.5.6.167.g86f2\n"},{"id":"80511","messageId":"20080620184503.GD7369@leksak.fem-net","threadId":"14052","inReplyTo":"alpine.DEB.1.00.0806201344180.6439@racer","subject":"Re: [PATCH 2/3] rebase-i: slight internal improvements","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T18:45:03Z","receivedAt":"2008-06-20T18:45:03Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"On Fri, Jun 20, 2008 at 01:46:29PM +0100, Johannes Schindelin <Johannes.Schindelin@gmx.de> wrote to Cc git@vger.kernel.org:\n> Hi,\n> \n> On Fri, 20 Jun 2008, Stephan Beyer wrote:\n> \n> > Looks like *portable* shell programming is no fun :\\\n> \n> That is right.  That's one of the reasons why I prefer moving scripts to \n> builtins: prototyping is good and well, but when you need to put it into \n> production, where people have all kinds of weird setups \n\nRight.\n\n> (just think of dash in Ubuntu!)\n\nWell, I'm using dash as /bin/sh in Debian.\nWhat's so weird about it?  IIRC it allows POSIX + some Berkeley extensions\nand so it is far less weird as the least common demoninator of shell\nportability ;-)\n\nHmm,\nFor shell portability it'd be cool to have something like a \"badsh\" (bad\nshell) with the whole XCU Utilities as builtins without features and\nwarnings if features want to be used that are not supported by at least\n95% of the systems.  So that scripts could be checked using badsh and\nthen you know, that it is portable.\nI guess nobody ever wrote something like that. ;-)\n\n> Better to use something portable, such as C.\n\nRight.\n\n> So would you not agree that PATCH 2/3 is rather unnecessary?\n\nWe wanted to make some upfront patches to am/rebase-i, so that, when the\ngit-sequencer prototype swoops in, it's easier to see, what is\ntaken from am and what is taken from rebase-i.\nBut this seems to be not so easy, so I'm currently thinking that I skip\nthat and concentrate on the builtin.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"80512","messageId":"X-0hXtX7hZGzbL_zS7e4VUMsiMfWiIfABUCFp28XZx0@cipher.nrlssc.navy.mil","threadId":"14052","inReplyTo":"1213986614-19536-1-git-send-email-s-beyer@gmx.net","subject":"Re: [PATCH 1/2] t3404: extra checks and s/! git/test_must_fail git/","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2008-06-20T18:48:32Z","receivedAt":"2008-06-20T18:48:32Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"Stephan Beyer wrote:\n\n> @@ -380,7 +397,7 @@ test_expect_success 'interrupted squash works as expected' '\n>  \t! FAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n\nThese can be converted to use test_must_fail by using a sub-shell\nas Junio demonstrated:\n\n\t(\n\t\tFAKE_LINES=\"1 squash 3 2\" &&\n\t\texport FAKE_LINES &&\n\t\ttest_must_fail git rebase -i HEAD~3\n\t) &&\n\n-brandon\n"},{"id":"80513","messageId":"20080620190037.GE7369@leksak.fem-net","threadId":"14052","inReplyTo":"X-0hXtX7hZGzbL_zS7e4VUMsiMfWiIfABUCFp28XZx0@cipher.nrlssc.navy.mil","subject":"Re: [PATCH 1/2] t3404: extra checks and s/! git/test_must_fail git/","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-20T19:00:37Z","receivedAt":"2008-06-20T19:00:37Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\n> > @@ -380,7 +397,7 @@ test_expect_success 'interrupted squash works as expected' '\n> >  \t! FAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n> \n> These can be converted to use test_must_fail by using a sub-shell\n> as Junio demonstrated:\n> \n> \t(\n> \t\tFAKE_LINES=\"1 squash 3 2\" &&\n> \t\texport FAKE_LINES &&\n> \t\ttest_must_fail git rebase -i HEAD~3\n> \t) &&\n\nPerhaps I'm not consequent, but I thought that it's not worth it ;-)\n\n(There is also another reason: I use a dirty test-lib.sh _hack_ locally,\nthat allows me to exactly see where a failing test_expect_success patch\nfails (that saves some time), but the hack does not work on tests with a\nsubshell invocation.)\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"80521","messageId":"20080621071812.6117@nanako3.lavabit.com","threadId":"14052","inReplyTo":"20080620190037.GE7369@leksak.fem-net","subject":"Re: [PATCH 1/2] t3404: extra checks and s/! git/test_must_fail git/","fromName":"しらいしななこ","fromEmail":"nanako3@lavabit.com","sentAt":"2008-06-20T22:18:12Z","receivedAt":"2008-06-20T22:18:12Z","isPatch":true,"sender":{"key":"nanako3@lavabit.com","avatar":"https://gravatar.com/avatar/3777b9e201c5883a62b1a6fdf7c53f2d712d1d80989146063ea861e33aad72a8?d=mp&s=160"},"body":"Quoting Stephan Beyer <s-beyer@gmx.net>:\n\n> Hi,\n>\n>> > @@ -380,7 +397,7 @@ test_expect_success 'interrupted squash works as expected' '\n>> >  \t! FAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n>> \n>> These can be converted to use test_must_fail by using a sub-shell\n>> as Junio demonstrated:\n>> \n>> \t(\n>> \t\tFAKE_LINES=\"1 squash 3 2\" &&\n>> \t\texport FAKE_LINES &&\n>> \t\ttest_must_fail git rebase -i HEAD~3\n>> \t) &&\n>\n> Perhaps I'm not consequent, but I thought that it's not worth it ;-)\n\nDoesn't that logic make the other s/!/test_must_fail/ changes\nalso not worth it?  What is the reason behind the change?\n\nI think your subject line and the message is worse than your\nprevious one.  You are saying *HOW* you changed it, without\nsaying *WHY* nor *WHAT FOR*.\n\nI may have written your log message like this:\n\n\tSubject: t3404: tighten git-rebase tests\n\n\tIn preparation for rewriting git-rebase in C, replace the way a\n\tfailure is currently detected with \"! git\" to use test_must_fail\n\tso that we do not confuse a broken rebase that dumps core with a\n\tcorrectly failing one.\n\nalthough I do not know if you are rewriting git-rebase in C\n(^_^).  The point I learned from this project is to say why it\nis done that way, not how you did it.  The latter can be seen in\nthe diff.\n\n-- \nNanako Shiraishi\nhttp://ivory.ap.teacup.com/nanako3/\n"},{"id":"80527","messageId":"20080621014636.GG7369@leksak.fem-net","threadId":"14052","inReplyTo":"20080621071812.6117@nanako3.lavabit.com","subject":"Re: [PATCH 1/2] t3404: extra checks and s/! git/test_must_fail git/","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-21T01:46:36Z","receivedAt":"2008-06-21T01:46:36Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\n> > Perhaps I'm not consequent, but I thought that it's not worth it ;-)\n> \n> Doesn't that logic make the other s/!/test_must_fail/ changes\n> also not worth it?  What is the reason behind the change?\n\nThe s/!/test_must_fail/ is just an \"extra\" like\n \"Hey, you're currently standing, can you bring me some tea?\"\n\nIn this case:\n \"Oh, I'm currently adding some tests, so I can s/!/test_must_fail/\"\n\n> I think your subject line and the message is worse than your\n> previous one.  You are saying *HOW* you changed it,\n\nNot exactly.\nIn the previous one I said, what my patch does: improve t3404.\nThe latter one said it, too, but a little more specific.\n\n> without saying *WHY* nor *WHAT FOR*.\n\nThat's right.\n\nThe s/!/test_must_fail/ is, as I said, just an \"extra\".\nAnd one that does no harm at all.\n\nThe others are tests that were useful during git sequencer prototype\ndevelopment, because once a test in the middle of the test suite failed\nbecause the branch was not correctly reset in one of the invocations of\nrebase-i in the first tests.\n\nWell, but I wonder if a long explanation is always necessary.\nIt is on feature patches and bugfix patches.  But here?\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"80540","messageId":"7v4p7nazof.fsf@gitster.siamese.dyndns.org","threadId":"14052","inReplyTo":"20080621014636.GG7369@leksak.fem-net","subject":"Re: [PATCH 1/2] t3404: extra checks and s/! git/test_must_fail git/","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2008-06-21T09:46:08Z","receivedAt":"2008-06-21T09:46:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Stephan Beyer <s-beyer@gmx.net> writes:\n\n>> > Perhaps I'm not consequent, but I thought that it's not worth it ;-)\n>> \n>> Doesn't that logic make the other s/!/test_must_fail/ changes\n>> also not worth it?  What is the reason behind the change?\n>\n> The s/!/test_must_fail/ is just an \"extra\" like\n>  \"Hey, you're currently standing, can you bring me some tea?\"\n\nCounting the places that were affected, I would not call which one is primary\nchange and which one is extra.  The later half of your patch is all about\ntest_must_fail isn't it?\n\nI am all for making tests more careful, and I think more use of\ntest_must_fail makes quite a lot of sense.  Please don't do a half-ass job if\nyou are doing the conversion anyway.\n\nAbout the commit log message, I tend to agree that your original subject\nlooked ugly and it would have been nicer to just say \"t3404: more strict\ntests for git-rebase\" or something like that, but probably an empty commit\nmessage body would have been Ok.\n"},{"id":"80580","messageId":"1214092551-8075-1-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":"7v4p7nazof.fsf@gitster.siamese.dyndns.org","subject":"[PATCH v3 1/2] t3404: stricter tests for git-rebase--interactive","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-21T23:55:50Z","receivedAt":"2008-06-21T23:55:50Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Signed-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\nHi,\n\nok, next try.\nBecause I do not want to do a half-ass job, I changed\nthe remaining ! git to test_must_fail and changed the commit\nmessage subject and removed the commit message body. ;-)\n\nAgain, this only applies cleanly to \"pu\".\n\n t/t3404-rebase-interactive.sh |   43 ++++++++++++++++++++++++++++++++--------\n 1 files changed, 34 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex e6f3fad..940eb24 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -107,6 +107,7 @@ chmod a+x fake-editor.sh\n \n test_expect_success 'no changes are a nop' '\n \tgit rebase -i F &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch2\" &&\n \ttest $(git rev-parse I) = $(git rev-parse HEAD)\n '\n \n@@ -115,14 +116,26 @@ test_expect_success 'test the [branch] option' '\n \tgit rm file6 &&\n \tgit commit -m \"stop here\" &&\n \tgit rebase -i F branch2 &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch2\" &&\n+\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n \ttest $(git rev-parse I) = $(git rev-parse HEAD)\n '\n \n+test_expect_success 'test --onto <branch>' '\n+\tgit checkout -b test-onto branch2 &&\n+\tgit rebase -i --onto branch1 F &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/test-onto\" &&\n+\ttest $(git rev-parse HEAD^) = $(git rev-parse branch1) &&\n+\ttest $(git rev-parse I) = $(git rev-parse branch2)\n+'\n+\n test_expect_success 'rebase on top of a non-conflicting commit' '\n \tgit checkout branch1 &&\n \tgit tag original-branch1 &&\n \tgit rebase -i branch2 &&\n \ttest file6 = $(git diff --name-only original-branch1) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\" &&\n+\ttest $(git rev-parse I) = $(git rev-parse branch2) &&\n \ttest $(git rev-parse I) = $(git rev-parse HEAD~2)\n '\n \n@@ -155,9 +168,12 @@ EOF\n \n test_expect_success 'stop on conflicting pick' '\n \tgit tag new-branch1 &&\n-\t! git rebase -i master &&\n+\ttest_must_fail git rebase -i master &&\n+\ttest \"$(git rev-parse HEAD~3)\" = \"$(git rev-parse master)\" &&\n \ttest_cmp expect .git/.dotest-merge/patch &&\n \ttest_cmp expect2 file1 &&\n+\ttest \"$(git-diff --name-status |\n+\t\tsed -n -e \"/^U/s/^U[^a-z]*//p\")\" = file1 &&\n \ttest 4 = $(grep -v \"^#\" < .git/.dotest-merge/done | wc -l) &&\n \ttest 0 = $(grep -c \"^[^#]\" < .git/.dotest-merge/git-rebase-todo)\n '\n@@ -165,6 +181,7 @@ test_expect_success 'stop on conflicting pick' '\n test_expect_success 'abort' '\n \tgit rebase --abort &&\n \ttest $(git rev-parse new-branch1) = $(git rev-parse HEAD) &&\n+\ttest \"$(git symbolic-ref -q HEAD)\" = \"refs/heads/branch1\" &&\n \t! test -d .git/.dotest-merge\n '\n \n@@ -331,7 +348,7 @@ test_expect_success 'interactive -t preserves tags' '\n test_expect_success '--continue tries to commit' '\n \tgit checkout to-be-rebased &&\n \ttest_tick &&\n-\t! git rebase -i --onto new-branch1 HEAD^ &&\n+\ttest_must_fail git rebase -i --onto new-branch1 HEAD^ &&\n \techo resolved > file1 &&\n \tgit add file1 &&\n \tFAKE_COMMIT_MESSAGE=\"chouette!\" git rebase --continue &&\n@@ -342,7 +359,7 @@ test_expect_success '--continue tries to commit' '\n test_expect_success 'verbose flag is heeded, even after --continue' '\n \tgit reset --hard HEAD@{1} &&\n \ttest_tick &&\n-\t! git rebase -v -i --onto new-branch1 HEAD^ &&\n+\ttest_must_fail git rebase -v -i --onto new-branch1 HEAD^ &&\n \techo resolved > file1 &&\n \tgit add file1 &&\n \tgit rebase --continue > output &&\n@@ -377,10 +394,14 @@ test_expect_success 'interrupted squash works as expected' '\n \t\tgit commit -m $n\n \tdone &&\n \tone=$(git rev-parse HEAD~3) &&\n-\t! FAKE_LINES=\"1 squash 3 2\" git rebase -i HEAD~3 &&\n+\t(\n+\t\tFAKE_LINES=\"1 squash 3 2\" &&\n+\t\texport FAKE_LINES &&\n+\t\ttest_must_fail git rebase -i HEAD~3\n+\t) &&\n \t(echo one; echo two; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \techo resolved > conflict &&\n \tgit add conflict &&\n \tgit rebase --continue &&\n@@ -395,13 +416,17 @@ test_expect_success 'interrupted squash works as expected (case 2)' '\n \t\tgit commit -m $n\n \tdone &&\n \tone=$(git rev-parse HEAD~3) &&\n-\t! FAKE_LINES=\"3 squash 1 2\" git rebase -i HEAD~3 &&\n+\t(\n+\t\tFAKE_LINES=\"3 squash 1 2\" &&\n+\t\texport FAKE_LINES &&\n+\t\ttest_must_fail git rebase -i HEAD~3\n+\t) &&\n \t(echo one; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \t(echo one; echo two; echo four) > conflict &&\n \tgit add conflict &&\n-\t! git rebase --continue &&\n+\ttest_must_fail git rebase --continue &&\n \techo resolved > conflict &&\n \tgit add conflict &&\n \tgit rebase --continue &&\n@@ -449,7 +474,7 @@ test_expect_success 'rebase a commit violating pre-commit' '\n \tchmod a+x $PRE_COMMIT &&\n \techo \"monde! \" >> file1 &&\n \ttest_tick &&\n-\t! git commit -m doesnt-verify file1 &&\n+\ttest_must_fail git commit -m doesnt-verify file1 &&\n \tgit commit -m doesnt-verify --no-verify file1 &&\n \ttest_tick &&\n \tFAKE_LINES=2 git rebase -i HEAD~2\n-- \n1.5.6.310.g344d\n"},{"id":"80581","messageId":"1214092551-8075-2-git-send-email-s-beyer@gmx.net","threadId":"14052","inReplyTo":"1214092551-8075-1-git-send-email-s-beyer@gmx.net","subject":"[PATCH v3 2/2] Make rebase--interactive use OPTIONS_SPEC","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-06-21T23:55:51Z","receivedAt":"2008-06-21T23:55:51Z","isPatch":true,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Also add some checks that --continue/--abort/--skip\nactions are used without --onto, -p, -t, etc.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\nHi,\n\nI resent this patch, too, because I've changed something:\nTo make the OPTIONS_SPEC more consistent with other OPTIONS_SPECs,\nI lowe-cased the first letters of the help string for each option.\n\nRegards,\n  Stephan\n\n\n git-rebase--interactive.sh |   71 +++++++++++++++++++++++++++++--------------\n 1 files changed, 48 insertions(+), 23 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 3f926d8..f13768c 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -10,10 +10,27 @@\n # The original idea comes from Eric W. Biederman, in\n # http://article.gmane.org/gmane.comp.version-control.git/22407\n \n-USAGE='(--continue | --abort | --skip | [--preserve-merges] [--first-parent]\n-\t[--preserve-tags] [--verbose] [--onto <branch>] <upstream> [<branch>])'\n+OPTIONS_KEEPDASHDASH=\n+OPTIONS_SPEC=\"\\\n+git-rebase [-i] [options] [--] <upstream> [<branch>]\n+git-rebase [-i] (--continue | --abort | --skip)\n+--\n+ Available options are\n+p,preserve-merges  try to recreate merges instead of ignoring them\n+t,preserve-tags    update tags to the new commit object\n+m,merge            always used (no-op)\n+i,interactive      always used (no-op)\n+onto=              rebase onto given branch instead of upstream\n+v,verbose          display a diffstat of what changed upstream\n+ When preserving merges\n+f,first-parent     show only commits following the first parent of each commit\n+s,strategy=        use the given merge strategy\n+ Actions:\n+continue           continue rebasing process\n+abort              abort rebasing process and restore original branch\n+skip               skip current patch and continue rebasing process\n+\"\n \n-OPTIONS_SPEC=\n . git-sh-setup\n require_work_tree\n \n@@ -25,6 +42,8 @@ SQUASH_MSG=\"$DOTEST\"/message-squash\n PRESERVE_MERGES=\n STRATEGY=\n VERBOSE=\n+ONTO=\n+MARK_PREFIX='refs/rebase-marks'\n test -f \"$DOTEST\"/strategy && STRATEGY=\"$(cat \"$DOTEST\"/strategy)\"\n test -f \"$DOTEST\"/verbose && VERBOSE=t\n \n@@ -515,10 +534,19 @@ create_extended_todo_list () {\n \tdone\n }\n \n+is_standalone () {\n+\ttest $# -eq 2 -a \"$2\" = '--' &&\n+\ttest -z \"$ONTO\" &&\n+\ttest -z \"$PRESERVE_TAGS\" &&\n+\ttest -z \"$PRESERVE_MERGES\" &&\n+\ttest -z \"$FIRST_PARENT\"\n+}\n+\n while test $# != 0\n do\n \tcase \"$1\" in\n \t--continue)\n+\t\tis_standalone \"$@\" || usage\n \t\tcomment_for_reflog continue\n \n \t\ttest -d \"$DOTEST\" || die \"No interactive rebase running\"\n@@ -551,6 +579,7 @@ do\n \t\tdo_rest\n \t\t;;\n \t--abort)\n+\t\tis_standalone \"$@\" || usage\n \t\tcomment_for_reflog abort\n \n \t\tgit rerere clear\n@@ -568,6 +597,7 @@ do\n \t\texit\n \t\t;;\n \t--skip)\n+\t\tis_standalone \"$@\" || usage\n \t\tcomment_for_reflog skip\n \n \t\tgit rerere clear\n@@ -575,7 +605,7 @@ do\n \n \t\toutput git reset --hard && do_rest\n \t\t;;\n-\t-s|--strategy)\n+\t-s)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n \t\t\tSTRATEGY=\"-s \"$(expr \"z$1\" : 'z-[^=]*=\\(.*\\)') ;;\n@@ -586,32 +616,36 @@ do\n \t\t\tshift ;;\n \t\tesac\n \t\t;;\n-\t-m|--merge)\n+\t-m)\n \t\t# we use merge anyway\n \t\t;;\n-\t-C*)\n-\t\tdie \"Interactive rebase uses merge, so $1 does not make sense\"\n-\t\t;;\n-\t-v|--verbose)\n+\t-v)\n \t\tVERBOSE=t\n \t\t;;\n-\t-p|--preserve-merges)\n+\t-p)\n \t\tPRESERVE_MERGES=t\n \t\t;;\n-\t-f|--first-parent)\n+\t-f)\n \t\tFIRST_PARENT=t\n \t\tPRESERVE_MERGES=t\n \t\t;;\n-\t-t|--preserve-tags)\n+\t-t)\n \t\tPRESERVE_TAGS=t\n \t\t;;\n-\t-i|--interactive)\n+\t-i)\n \t\t# yeah, we know\n \t\t;;\n+\t--onto)\n+\t\tshift\n+\t\tONTO=$(git rev-parse --verify \"$1\") ||\n+\t\t\tdie \"Does not point to a valid commit: $1\"\n+\t\t;;\n \t''|-h)\n \t\tusage\n \t\t;;\n-\t*)\n+\t--)\n+\t\tshift\n+\t\ttest $# -eq 1 -o $# -eq 2 || usage\n \t\ttest -d \"$DOTEST\" &&\n \t\t\tdie \"Interactive rebase already started\"\n \n@@ -620,15 +654,6 @@ do\n \n \t\tcomment_for_reflog start\n \n-\t\tONTO=\n-\t\tcase \"$1\" in\n-\t\t--onto)\n-\t\t\tONTO=$(git rev-parse --verify \"$2\") ||\n-\t\t\t\tdie \"Does not point to a valid commit: $2\"\n-\t\t\tshift; shift\n-\t\t\t;;\n-\t\tesac\n-\n \t\trequire_clean_work_tree\n \n \t\tUPSTREAM=$(git rev-parse --verify \"$1\") || die \"Invalid base\"\n-- \n1.5.6.310.g344d\n"}]}