{"thread":{"id":"22753","subject":"Re: working out where git-rebase is up to?","startedAt":"2010-02-22T10:09:18Z","lastAt":"2010-02-22T10:51:36Z","messageCount":6,"participants":["Marc Weber","Jon Seymour","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"135289","messageId":"2cfc40321002220209pe1942ecucb3716f60bf05d32@mail.gmail.com","threadId":"22753","inReplyTo":null,"subject":"working out where git-rebase is up to?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2010-02-22T10:09:18Z","receivedAt":"2010-02-22T10:09:18Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Hi,\n\nFor my funky \"compensating rebases\" I need to know where an automated\nrebase has stopped. In particular, I need to know the sha1 of the\ncommit that caused the rebase to stop.\n\nNo doubt rebase is tracking this info, but is there a supported way to\ndiscover it?\n\njon.\n"},{"id":"135288","messageId":"1266833879-sup-7619@nixos","threadId":"22753","inReplyTo":"2cfc40321002220209pe1942ecucb3716f60bf05d32@mail.gmail.com","subject":"Re: working out where git-rebase is up to?","fromName":"Marc Weber","fromEmail":"marco-oweber@gmx.de","sentAt":"2010-02-22T10:19:56Z","receivedAt":"2010-02-22T10:19:56Z","isPatch":false,"sender":{"key":"marco-oweber@gmx.de","avatar":null},"body":"> No doubt rebase is tracking this info, but is there a supported way to\n> discover it?\n\nI may be mistaken. But git-rebase basically applies patches on top of a\nbranch. And the branch it's operating on is checked out.\nSo can't you just do \n\n  git rev-parse HEAD\n\nto find out?\n\nAlso have a look at the output. git rebase tells you which patch it is\napplying.\n\nMarc Weber\n"},{"id":"135298","messageId":"201002221126.47372.trast@student.ethz.ch","threadId":"22753","inReplyTo":"2cfc40321002220209pe1942ecucb3716f60bf05d32@mail.gmail.com","subject":"Re: working out where git-rebase is up to?","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-02-22T10:26:47Z","receivedAt":"2010-02-22T10:26:47Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"On Monday 22 February 2010 11:09:18 Jon Seymour wrote:\n> Hi,\n> \n> For my funky \"compensating rebases\" I need to know where an automated\n> rebase has stopped. In particular, I need to know the sha1 of the\n> commit that caused the rebase to stop.\n> \n> No doubt rebase is tracking this info, but is there a supported way to\n> discover it?\n\nIt's in .git/rebase-merge/done (and .git/rebase-merge/git-rebase-todo\nfor the remaining TODO file).  Maybe we should add a 'git rebase\n--whydiditstop' command ;-)\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"135296","messageId":"2cfc40321002220247q1b73ac32v6ff39035a61a6a1@mail.gmail.com","threadId":"22753","inReplyTo":"201002221126.47372.trast@student.ethz.ch","subject":"Re: working out where git-rebase is up to?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2010-02-22T10:47:04Z","receivedAt":"2010-02-22T10:47:04Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"Once I am done with my compensating rebase, rebase won't have to stop :-)\n\njon.\n\nOn Mon, Feb 22, 2010 at 9:26 PM, Thomas Rast <trast@student.ethz.ch> wrote:\n> On Monday 22 February 2010 11:09:18 Jon Seymour wrote:\n>> Hi,\n>>\n>> For my funky \"compensating rebases\" I need to know where an automated\n>> rebase has stopped. In particular, I need to know the sha1 of the\n>> commit that caused the rebase to stop.\n>>\n>> No doubt rebase is tracking this info, but is there a supported way to\n>> discover it?\n>\n> It's in .git/rebase-merge/done (and .git/rebase-merge/git-rebase-todo\n> for the remaining TODO file).  Maybe we should add a 'git rebase\n> --whydiditstop' command ;-)\n>\n> --\n> Thomas Rast\n> trast@{inf,student}.ethz.ch\n>\n"},{"id":"135299","messageId":"201002221149.32504.trast@student.ethz.ch","threadId":"22753","inReplyTo":"201002221126.47372.trast@student.ethz.ch","subject":"Re: working out where git-rebase is up to?","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2010-02-22T10:49:32Z","receivedAt":"2010-02-22T10:49:32Z","isPatch":false,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"On Monday 22 February 2010 11:26:47 Thomas Rast wrote:\n> On Monday 22 February 2010 11:09:18 Jon Seymour wrote:\n> > For my funky \"compensating rebases\" I need to know where an automated\n> > rebase has stopped. In particular, I need to know the sha1 of the\n> > commit that caused the rebase to stop.\n> > \n> > No doubt rebase is tracking this info, but is there a supported way to\n> > discover it?\n> \n> It's in .git/rebase-merge/done (and .git/rebase-merge/git-rebase-todo\n> for the remaining TODO file).  Maybe we should add a 'git rebase\n> --whydiditstop' command ;-)\n\nHere's a lightly tested draft patch.  I should stop stealing work time\nfor this, but you're welcome to fill in docs and tests and submit it.\n\ndiff --git i/git-rebase--interactive.sh w/git-rebase--interactive.sh\nindex 415ae72..d34c057 100755\n--- i/git-rebase--interactive.sh\n+++ w/git-rebase--interactive.sh\n@@ -13,7 +13,7 @@\n OPTIONS_KEEPDASHDASH=\n OPTIONS_SPEC=\"\\\n git-rebase [-i] [options] [--] <upstream> [<branch>]\n-git-rebase [-i] (--continue | --abort | --skip)\n+git-rebase [-i] (--continue | --abort | --skip | --status)\n --\n  Available options are\n v,verbose          display a diffstat of what changed upstream\n@@ -26,6 +26,7 @@ i,interactive      always used (no-op)\n continue           continue rebasing process\n abort              abort rebasing process and restore original branch\n skip               skip current patch and continue rebasing process\n+status\t           show where the rebasing process stopped\n no-verify          override pre-rebase hook from stopping the operation\n root               rebase all reachable commmits up to the root(s)\n autosquash         move commits that begin with squash!/fixup! under -i\n@@ -103,6 +104,10 @@ AMEND=\"$DOTEST\"/amend\n REWRITTEN_LIST=\"$DOTEST\"/rewritten-list\n REWRITTEN_PENDING=\"$DOTEST\"/rewritten-pending\n \n+# This file holds the status message that we showed to the user when\n+# stopping, so that it can be retrieved by 'git rebase --status'.\n+STATUS=\"$DOTEST\"/status\n+\n PRESERVE_MERGES=\n STRATEGY=\n ONTO=\n@@ -204,11 +209,16 @@ make_patch () {\n \t\tget_author_ident_from_commit \"$1\" > \"$AUTHOR_SCRIPT\"\n }\n \n+status_message () {\n+\tcat >> \"$STATUS\"\n+\t\"$1\" \"$(cat \"$STATUS\")\"\n+}\n+\n die_with_patch () {\n \techo \"$1\" > \"$DOTEST\"/stopped-sha\n \tmake_patch \"$1\"\n \tgit rerere\n-\tdie \"$2\"\n+\tstatus_message die \"$2\"\n }\n \n die_abort () {\n@@ -429,8 +439,10 @@ die_failed_squash() {\n \tmv \"$SQUASH_MSG\" \"$MSG\" || exit\n \trm -f \"$FIXUP_MSG\"\n \tcp \"$MSG\" \"$GIT_DIR\"/MERGE_MSG || exit\n-\twarn\n-\twarn \"Could not apply $1... $2\"\n+\tstatus_message warn <<EOF\n+\n+Could not apply $1... $2\n+EOF\n \tdie_with_patch $1 \"\"\n }\n \n@@ -455,7 +467,7 @@ record_in_rewritten() {\n }\n \n do_next () {\n-\trm -f \"$MSG\" \"$AUTHOR_SCRIPT\" \"$AMEND\" || exit\n+\trm -f \"$MSG\" \"$AUTHOR_SCRIPT\" \"$AMEND\" \"$STATUS\" || exit\n \tread command sha1 rest < \"$TODO\"\n \tcase \"$command\" in\n \t'#'*|''|noop)\n@@ -487,15 +499,17 @@ do_next () {\n \t\techo \"$1\" > \"$DOTEST\"/stopped-sha\n \t\tmake_patch $sha1\n \t\tgit rev-parse --verify HEAD > \"$AMEND\"\n-\t\twarn \"Stopped at $sha1... $rest\"\n-\t\twarn \"You can amend the commit now, with\"\n-\t\twarn\n-\t\twarn \"\tgit commit --amend\"\n-\t\twarn\n-\t\twarn \"Once you are satisfied with your changes, run\"\n-\t\twarn\n-\t\twarn \"\tgit rebase --continue\"\n-\t\twarn\n+\t\tstatus_message warn <<EOF\n+Stopped at $sha1... $rest\n+You can amend the commit now, with\n+\n+\tgit commit --amend\n+\n+Once you are satisfied with your changes, run\n+\n+\tgit rebase --continue\n+\n+EOF\n \t\texit 0\n \t\t;;\n \tsquash|s|fixup|f)\n@@ -767,6 +781,24 @@ first and then run 'git rebase --continue' again.\"\n \n \t\toutput git reset --hard && do_rest\n \t\t;;\n+\t--status)\n+\t\tis_standalone \"$@\" || usage\n+\t\twarn \"Your rebase stopped at the following action:\"\n+\t\twarn\n+\t\twarn \"    $(tail -1 \"$DOTEST\"/done)\"\n+\t\twarn\n+\t\tnext=\"$(sed -n -e \"/^#/d\" -e '/^$/d' -e \"/ /p\" -e \"q\" < \"$TODO\")\"\n+\t\tif test -n \"$next\"; then\n+\t\t\twarn \"The next action will be:\"\n+\t\t\twarn\n+\t\t\twarn \"    $next\"\n+\t\telse\n+\t\t\twarn \"There are no more actions left after this one.\"\n+\t\tfi\n+\t\twarn\n+\t\tcat \"$STATUS\" >&2\n+\t\texit\n+\t\t;;\n \t-s)\n \t\tcase \"$#,$1\" in\n \t\t*,*=*)\n\n\n-- \nThomas Rast\ntrast@{inf,student}.ethz.ch\n"},{"id":"135292","messageId":"2cfc40321002220251g7d7230a3g84753678f5d79d44@mail.gmail.com","threadId":"22753","inReplyTo":"201002221149.32504.trast@student.ethz.ch","subject":"Re: working out where git-rebase is up to?","fromName":"Jon Seymour","fromEmail":"jon.seymour@gmail.com","sentAt":"2010-02-22T10:51:36Z","receivedAt":"2010-02-22T10:51:36Z","isPatch":false,"sender":{"key":"jon.seymour@gmail.com","avatar":"https://avatars.githubusercontent.com/u/207131?v=4"},"body":"> Here's a lightly tested draft patch.  I should stop stealing work time\n> for this, but you're welcome to fill in docs and tests and submit it.\n>\n\nThanks! I'll give it a whirl.\n\njon.\n"}]}