{"thread":{"id":"27961","subject":"[PATCH 0/2] rebase -i: Some nice-to-have behaviors for \"reword\"","startedAt":"2011-07-25T03:38:31Z","lastAt":"2011-07-30T11:52:17Z","messageCount":4,"participants":["Andrew Wong","Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"172370","messageId":"1311565113-5022-1-git-send-email-andrew.kw.w@gmail.com","threadId":"27961","inReplyTo":null,"subject":"[PATCH 0/2] rebase -i: Some nice-to-have behaviors for \"reword\"","fromName":"Andrew Wong","fromEmail":"andrew.kw.w@gmail.com","sentAt":"2011-07-25T03:38:31Z","receivedAt":"2011-07-25T03:38:31Z","isPatch":true,"sender":{"key":"andrew.kw.w@gmail.com","avatar":"https://avatars.githubusercontent.com/u/489311?v=4"},"body":"I've been using the \"reword\" command fairly often, and these are two small\nmodifications that I've always wished I could do during a \"reword\".  They're\nmore of a convenience than anything.  Hopefully they're not derailing the\noriginal intent of \"reword\" too much...\n\n1/2:\nOften times when I need to reword commit, it's because the commit message was\nunclear.  So when the \"commit --amend\" happens, I often found myself having to\ndo a \"show HEAD\" to inspect the diff to figure out what the commit was actually\ndoing.  This patch saves me this extra step.  Since this behavior isn't what\nusers might expect when they run \"rebase -v\", maybe I'm better off putting this\ninto a new flag, like \"rebase --commit-verbose\".  Any thoughts?\n\n2/2:\nSometimes when I'm rewording a bunch of commits, I'd realize that I actually\nwant to edit the commit that I'm current rewording, like a quick fix or\nsomething.  Or I might even want to abort the entire rebase operation\naltogether.  This patch provides a way to gracefully to abort the \"reword\".  \n\nAndrew Wong (2):\n  rebase -i: run \"commit --amend\" with verbose if rebase was called\n    with -v\n  rebase -i: interrupt rebase when \"commit --amend\" failed\n\n git-rebase--interactive.sh |    5 ++++-\n 1 files changed, 4 insertions(+), 1 deletions(-)\n\n-- \n1.7.2.2\n"},{"id":"172372","messageId":"1311565113-5022-2-git-send-email-andrew.kw.w@gmail.com","threadId":"27961","inReplyTo":"1311565113-5022-1-git-send-email-andrew.kw.w@gmail.com","subject":"[PATCH 1/2] rebase -i: run \"commit --amend\" with verbose if rebase was called with -v","fromName":"Andrew Wong","fromEmail":"andrew.kw.w@gmail.com","sentAt":"2011-07-25T03:38:32Z","receivedAt":"2011-07-25T03:38:32Z","isPatch":true,"sender":{"key":"andrew.kw.w@gmail.com","avatar":"https://avatars.githubusercontent.com/u/489311?v=4"},"body":"This provides a convenient way to inspect the diff while rewording\ncommits, which is really useful when rewording commit messages that are\nunclear.\n\nSigned-off-by: Andrew Wong <andrew.kw.w@gmail.com>\n---\n git-rebase--interactive.sh |    4 +++-\n 1 files changed, 3 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex c6ba7c1..df9f7e9 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -392,10 +392,12 @@ do_next () {\n \treword|r)\n \t\tcomment_for_reflog reword\n \n+\t\ttest t = \"$verbose\" && commit_verbose_flag=--verbose\n+\n \t\tmark_action_done\n \t\tpick_one $sha1 ||\n \t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n-\t\tgit commit --amend --no-post-rewrite\n+\t\tgit commit $commit_verbose_flag --amend --no-post-rewrite\n \t\trecord_in_rewritten $sha1\n \t\t;;\n \tedit|e)\n-- \n1.7.2.2\n"},{"id":"172371","messageId":"1311565113-5022-3-git-send-email-andrew.kw.w@gmail.com","threadId":"27961","inReplyTo":"1311565113-5022-1-git-send-email-andrew.kw.w@gmail.com","subject":"[PATCH 2/2] rebase -i: interrupt rebase when \"commit --amend\" failed","fromName":"Andrew Wong","fromEmail":"andrew.kw.w@gmail.com","sentAt":"2011-07-25T03:38:33Z","receivedAt":"2011-07-25T03:38:33Z","isPatch":true,"sender":{"key":"andrew.kw.w@gmail.com","avatar":"https://avatars.githubusercontent.com/u/489311?v=4"},"body":"\"commit --amend\" could fail if the user empties the commit message.\nAlthough this is not a real error, it seems to make more sense to\ninterrupt the rebasing, rather than ignoring the error and continue on\nrebasing.  This gives users a way to gracefully interrupt a \"reword\" if\nthey decided they actually want to do an \"edit\", or even \"rebase\n--abort\".\n\nSigned-off-by: Andrew Wong <andrew.kw.w@gmail.com>\n---\n git-rebase--interactive.sh |    3 ++-\n 1 files changed, 2 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex df9f7e9..7055ef4 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -397,7 +397,8 @@ do_next () {\n \t\tmark_action_done\n \t\tpick_one $sha1 ||\n \t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n-\t\tgit commit $commit_verbose_flag --amend --no-post-rewrite\n+\t\tgit commit $commit_verbose_flag --amend --no-post-rewrite ||\n+\t\t\tdie_with_patch $sha1 \"Cannot amend commit after successfully picking $sha1... $rest\"\n \t\trecord_in_rewritten $sha1\n \t\t;;\n \tedit|e)\n-- \n1.7.2.2\n"},{"id":"172382","messageId":"CAGdFq_in9huck5kGo5N00jF53B2USsHy_CXb914jZrMZ4HpTUg@mail.gmail.com","threadId":"27961","inReplyTo":"1311565113-5022-3-git-send-email-andrew.kw.w@gmail.com","subject":"Re: [PATCH 2/2] rebase -i: interrupt rebase when \"commit --amend\" failed","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2011-07-30T11:52:17Z","receivedAt":"2011-07-30T11:52:17Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Mon, Jul 25, 2011 at 05:38, Andrew Wong <andrew.kw.w@gmail.com> wrote:\n> \"commit --amend\" could fail if the user empties the commit message.\n> Although this is not a real error, it seems to make more sense to\n> interrupt the rebasing, rather than ignoring the error and continue on\n> rebasing.  This gives users a way to gracefully interrupt a \"reword\" if\n> they decided they actually want to do an \"edit\", or even \"rebase\n> --abort\".\n\nYesplease. I've had this where I marked an entire patch series for\nreword only to discover on the first patch that I made a mistake, so I\nended up having to type \":wq\" some twenty times. It would have been\nmuch nicer if I could just have done \":cq\" once and then 'git rebase\n--abort'.\n\n-- \nCheers,\n\nSverre Rabbelier\n"}]}