{"thread":{"id":"21134","subject":"[PATCH] Teach 'rebase -i' the command \"reword\"","startedAt":"2009-10-05T16:16:17Z","lastAt":"2009-10-06T08:25:36Z","messageCount":8,"participants":["Björn Gustavsson","Johannes Schindelin","Sebastian Pipping","Stephen Boyd","Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"124259","messageId":"4ACA1BD1.6050905@gmail.com","threadId":"21134","inReplyTo":null,"subject":"[PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-10-05T16:16:17Z","receivedAt":"2009-10-05T16:16:17Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"Make it easier to edit just the commit message for a commit\nusing 'git rebase -i' by introducing the \"reword\" command.\n\nSigned-off-by: Björn Gustavsson <bgustavsson@gmail.com>\n---\n\nHere is the re-roll of my previous patch.\n\nThe only difference is that \"amend\" (which would be mis-leading)\nhas been replaced with \"reword\".\n\n Documentation/git-rebase.txt  |    3 +++\n git-rebase--interactive.sh    |    9 +++++++++\n t/lib-rebase.sh               |    6 +++---\n t/t3404-rebase-interactive.sh |   14 ++++++++++++++\n 4 files changed, 29 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 0aefc34..52af656 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -368,6 +368,9 @@ By replacing the command \"pick\" with the command \"edit\", you can tell\n the files and/or the commit message, amend the commit, and continue\n rebasing.\n \n+If you just want to edit the commit message for a commit, you can replace\n+the command \"pick\" with the command \"reword\".\n+\n If you want to fold two or more commits into one, replace the command\n \"pick\" with \"squash\" for the second and subsequent commit.  If the\n commits had different authors, it will attribute the squashed commit to\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 23ded48..30c2f62 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -340,6 +340,14 @@ do_next () {\n \t\tpick_one $sha1 ||\n \t\t\tdie_with_patch $sha1 \"Could not apply $sha1... $rest\"\n \t\t;;\n+\treword|r)\n+\t\tcomment_for_reflog reword\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\toutput git commit --amend\n+\t\t;;\n \tedit|e)\n \t\tcomment_for_reflog edit\n \n@@ -752,6 +760,7 @@ first and then run 'git rebase --continue' again.\"\n #\n # Commands:\n #  p, pick = use commit\n+#  r, reword = use commit, but allow editing of the commit message\n #  e, edit = use commit, but stop for amending\n #  s, squash = use commit, but meld into previous commit\n #\ndiff --git a/t/lib-rebase.sh b/t/lib-rebase.sh\nindex 260a231..62f452c 100644\n--- a/t/lib-rebase.sh\n+++ b/t/lib-rebase.sh\n@@ -9,8 +9,8 @@\n #\n #\t\"[<lineno1>] [<lineno2>]...\"\n #\n-#   If a line number is prefixed with \"squash\" or \"edit\", the respective line's\n-#   command will be replaced with the specified one.\n+#   If a line number is prefixed with \"squash\", \"edit\", or \"reword\", the\n+#   respective line's command will be replaced with the specified one.\n \n set_fake_editor () {\n \techo \"#!$SHELL_PATH\" >fake-editor.sh\n@@ -32,7 +32,7 @@ cat \"$1\".tmp\n action=pick\n for line in $FAKE_LINES; do\n \tcase $line in\n-\tsquash|edit)\n+\tsquash|edit|reword)\n \t\taction=\"$line\";;\n \t*)\n \t\techo sed -n \"${line}s/^pick/$action/p\"\ndiff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh\nindex 4cae019..3a37793 100755\n--- a/t/t3404-rebase-interactive.sh\n+++ b/t/t3404-rebase-interactive.sh\n@@ -470,4 +470,18 @@ test_expect_success 'avoid unnecessary reset' '\n \ttest 123456789 = $MTIME\n '\n \n+test_expect_success 'reword' '\n+\tgit checkout -b reword-branch master &&\n+\tFAKE_LINES=\"1 2 3 reword 4\" FAKE_COMMIT_MESSAGE=\"E changed\" git rebase -i A &&\n+\tgit show HEAD | grep \"E changed\" &&\n+\ttest $(git rev-parse master) != $(git rev-parse HEAD) &&\n+\ttest $(git rev-parse master^) = $(git rev-parse HEAD^) &&\n+\tFAKE_LINES=\"1 2 reword 3 4\" FAKE_COMMIT_MESSAGE=\"D changed\" git rebase -i A &&\n+\tgit show HEAD^ | grep \"D changed\" &&\n+\tFAKE_LINES=\"reword 1 2 3 4\" FAKE_COMMIT_MESSAGE=\"B changed\" git rebase -i A &&\n+\tgit show HEAD~3 | grep \"B changed\" &&\n+\tFAKE_LINES=\"1 reword 2 3 4\" FAKE_COMMIT_MESSAGE=\"C changed\" git rebase -i A &&\n+\tgit show HEAD~2 | grep \"C changed\"\n+'\n+\n test_done\n-- \n1.6.5.rc2.18.g020de\n"},{"id":"124272","messageId":"alpine.DEB.1.00.0910052236050.4985@pacific.mpi-cbg.de","threadId":"21134","inReplyTo":"4ACA1BD1.6050905@gmail.com","subject":"Re: [PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-10-05T20:38:07Z","receivedAt":"2009-10-05T20:38:07Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 5 Oct 2009, Björn Gustavsson wrote:\n\n> Make it easier to edit just the commit message for a commit\n> using 'git rebase -i' by introducing the \"reword\" command.\n> \n> Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>\n\nACK!\n\nThanks,\nDscho"},{"id":"124292","messageId":"4ACAA6DE.9080407@hartwork.org","threadId":"21134","inReplyTo":"4ACA1BD1.6050905@gmail.com","subject":"Re: [PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Sebastian Pipping","fromEmail":"webmaster@hartwork.org","sentAt":"2009-10-06T02:09:34Z","receivedAt":"2009-10-06T02:09:34Z","isPatch":true,"sender":{"key":"webmaster@hartwork.org","avatar":null},"body":"Björn Gustavsson wrote:\n> Make it easier to edit just the commit message for a commit\n> using 'git rebase -i' by introducing the \"reword\" command.\n\nAwesome!\n\n\n\nSebastian\n"},{"id":"124293","messageId":"4ACAACAB.3020707@gmail.com","threadId":"21134","inReplyTo":"4ACA1BD1.6050905@gmail.com","subject":"Re: [PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-10-06T02:34:19Z","receivedAt":"2009-10-06T02:34:19Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Björn Gustavsson wrote:\n> diff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\n> index 0aefc34..52af656 100644\n> --- a/Documentation/git-rebase.txt\n> +++ b/Documentation/git-rebase.txt\n> @@ -368,6 +368,9 @@ By replacing the command \"pick\" with the command \"edit\", you can tell\n>  the files and/or the commit message, amend the commit, and continue\n>  rebasing.\n>  \n> +If you just want to edit the commit message for a commit, you can replace\n> +the command \"pick\" with the command \"reword\".\n> +\nMaybe use the imperative here. So instead of \"you can replace\" just say\n\"replace\".\n\nAlso, two paragraphs down we say \"In both cases ...\" but now there are\nthree cases right? Maybe we should say\n\nWhen a \"pick\" doesn't succeed (because of merge errors) or when \"pick\"\nhas been replaced with another command, ...\n\n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> index 23ded48..30c2f62 100755\n> --- a/git-rebase--interactive.sh\n> +++ b/git-rebase--interactive.sh\n>\n> @@ -752,6 +760,7 @@ first and then run 'git rebase --continue' again.\"\n>  #\n>  # Commands:\n>  #  p, pick = use commit\n> +#  r, reword = use commit, but allow editing of the commit message\nHow about this?\n\nuse commit, but stop to edit (or reword?) the commit message\n"},{"id":"124295","messageId":"4ACAEBBA.9000806@gmail.com","threadId":"21134","inReplyTo":"4ACAACAB.3020707@gmail.com","subject":"Re: [PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-10-06T07:03:22Z","receivedAt":"2009-10-06T07:03:22Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"Stephen Boyd wrote:\n> Björn Gustavsson wrote:\n>> +If you just want to edit the commit message for a commit, you can replace\n>> +the command \"pick\" with the command \"reword\".\n>> +\n> Maybe use the imperative here. So instead of \"you can replace\" just say\n> \"replace\".\n\nYes, that's better.\n \n> Also, two paragraphs down we say \"In both cases ...\" but now there are\n> three cases right? Maybe we should say\n\nWell spotted. I didn't think about that.\n\nBut actually, I think that in \"In both cases...\" was wrong to begin\nwith, as there only is one case, namely if the command is \"edit\".\n\n>> +#  r, reword = use commit, but allow editing of the commit message\n> How about this?\n> \n> use commit, but stop to edit (or reword?) the commit message\n\nNo, I think that would be misleading, as \"stop\" means exit to the shell\nso that you can run other git commands. (The documentation says:\n\"...the loop will stop to let you fix things, and you can continue\n-the loop with `git rebase --continue`\")\n\n\nHere comes a patch that improves the documentation. It should be applied\non top of my previous patch and then combined with it.\n\nIf you want me to send a new, combined patch, I will of course do that.\n\n-- >8 --\nSubject: [PATCH] Minor polishing of documentation\n\nTo be combined with my previous patch.\n---\n Documentation/git-rebase.txt |   10 +++++-----\n 1 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 52af656..0ae8449 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -368,17 +368,17 @@ By replacing the command \"pick\" with the command \"edit\", you can tell\n the files and/or the commit message, amend the commit, and continue\n rebasing.\n \n-If you just want to edit the commit message for a commit, you can replace\n-the command \"pick\" with the command \"reword\".\n+If you just want to edit the commit message for a commit, replace the\n+command \"pick\" with the command \"reword\".\n \n If you want to fold two or more commits into one, replace the command\n \"pick\" with \"squash\" for the second and subsequent commit.  If the\n commits had different authors, it will attribute the squashed commit to\n the author of the first commit.\n \n-In both cases, or when a \"pick\" does not succeed (because of merge\n-errors), the loop will stop to let you fix things, and you can continue\n-the loop with `git rebase --continue`.\n+When \"pick\" has been replaced with \"edit\" or when a \"pick\" does not\n+succeed (because of merge errors), the loop will stop to let you fix\n+things, and you can continue the loop with `git rebase --continue`.\n \n For example, if you want to reorder the last 5 commits, such that what\n was HEAD~4 becomes the new HEAD. To achieve that, you would call\n-- \n1.6.5.rc2.18.g020de\n"},{"id":"124296","messageId":"4ACAF07D.2030604@viscovery.net","threadId":"21134","inReplyTo":"4ACAEBBA.9000806@gmail.com","subject":"Re: [PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2009-10-06T07:23:41Z","receivedAt":"2009-10-06T07:23:41Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Björn Gustavsson schrieb:\n> @@ -368,17 +368,17 @@ By replacing the command \"pick\" with the command \"edit\", you can tell\n>  the files and/or the commit message, amend the commit, and continue\n>  rebasing.\n>  \n> -If you just want to edit the commit message for a commit, you can replace\n> -the command \"pick\" with the command \"reword\".\n> +If you just want to edit the commit message for a commit, replace the\n> +command \"pick\" with the command \"reword\".\n>  \n>  If you want to fold two or more commits into one, replace the command\n>  \"pick\" with \"squash\" for the second and subsequent commit.  If the\n>  commits had different authors, it will attribute the squashed commit to\n>  the author of the first commit.\n>  \n> -In both cases, or when a \"pick\" does not succeed (because of merge\n> -errors), the loop will stop to let you fix things, and you can continue\n> -the loop with `git rebase --continue`.\n> +When \"pick\" has been replaced with \"edit\" or when a \"pick\" does not\n> +succeed (because of merge errors), the loop will stop to let you fix\n> +things, and you can continue the loop with `git rebase --continue`.\n\nSince \"reword\" is \"pick\" + editor, it can fail due to conflicts as well.\nPerhaps:\n\n'git-rebase' will stop after an edit command or when a command failed\n(due to merge errors). When you are done with your edits or with resolving\nmerge conflicts, continue with `git rebase --continue`.\n\n(I'm unsure about the mark-up.)\n\n-- Hannes\n"},{"id":"124298","messageId":"4ACAF515.2060403@gmail.com","threadId":"21134","inReplyTo":"4ACAEBBA.9000806@gmail.com","subject":"Re: [PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Stephen Boyd","fromEmail":"bebarino@gmail.com","sentAt":"2009-10-06T07:43:17Z","receivedAt":"2009-10-06T07:43:17Z","isPatch":true,"sender":{"key":"bebarino@gmail.com","avatar":"https://avatars.githubusercontent.com/u/38832?v=4"},"body":"Björn Gustavsson wrote:\n>> How about this?\n>>\n>> use commit, but stop to edit (or reword?) the commit message\n>\n> No, I think that would be misleading, as \"stop\" means exit to the shell\n> so that you can run other git commands. (The documentation says:\n> \"...the loop will stop to let you fix things, and you can continue\n> -the loop with `git rebase --continue`\")\n\nOk, \"stop\" being misleading makes sense but I still think the English is\nwrong. Particularly the part about allow editing. Maybe just remove\n\"stop\", so\n\n    use commit, but edit the commit message\n\n>\n> -In both cases, or when a \"pick\" does not succeed (because of merge\n> -errors), the loop will stop to let you fix things, and you can continue\n> -the loop with `git rebase --continue`.\n> +When \"pick\" has been replaced with \"edit\" or when a \"pick\" does not\n> +succeed (because of merge errors), the loop will stop to let you fix\n> +things, and you can continue the loop with `git rebase --continue`.\n>   \n\nPatch looks good, but if you decide to resend due to my comment above\nmaybe you could think about replacing the word \"loop\" with \"rebase\". We\nshould probably just say \"the rebase will stop\" and \"you can continue\nwith `git rebase ...\"\n\nOr we could combine yours, mine, and Hannes' versions.\n\nThe rebase will stop when \"pick\" has been replaced with \"edit\" or when a command fails due to merge errors. When you are done editing and/or resolving conflicts you can continue with `git rebase --continue`.\n"},{"id":"124299","messageId":"4ACAFF00.60704@gmail.com","threadId":"21134","inReplyTo":"4ACAF515.2060403@gmail.com","subject":"Re: [PATCH] Teach 'rebase -i' the command \"reword\"","fromName":"Björn Gustavsson","fromEmail":"bgustavsson@gmail.com","sentAt":"2009-10-06T08:25:36Z","receivedAt":"2009-10-06T08:25:36Z","isPatch":true,"sender":{"key":"bgustavsson@gmail.com","avatar":"https://avatars.githubusercontent.com/u/74840?v=4"},"body":"Thanks to both of you!\n\nStephen Boyd wrote:\n> Björn Gustavsson wrote:\n\n> Ok, \"stop\" being misleading makes sense but I still think the English is\n> wrong. Particularly the part about allow editing. Maybe just remove\n> \"stop\", so\n> \n>     use commit, but edit the commit message\n\nOK.\n\n> Or we could combine yours, mine, and Hannes' versions.\n> \n> The rebase will stop when \"pick\" has been replaced with \"edit\" or when a command fails due to merge errors. When you are done editing and/or resolving conflicts you can continue with `git rebase --continue`.\n> \n\nI changed \"The rebase\" to \"'git-rebase' to be consistent with the rest of the documentation.\n\nHere is a new patch, to be applied on top of my original patch.\n\nTo avoid confusion, I'll better re-roll the patch. But I'll wait\na day or so, in case there will be more corrections or suggestions\nfor improvements.\n\n-- >8 --\nSubject: [PATCH] Minor polishing of documentation, second attempt\n\nTo be applied on top of and combined with my original patch.\n---\n Documentation/git-rebase.txt |   10 +++++-----\n git-rebase--interactive.sh   |    2 +-\n 2 files changed, 6 insertions(+), 6 deletions(-)\n\ndiff --git a/Documentation/git-rebase.txt b/Documentation/git-rebase.txt\nindex 52af656..33e0ef1 100644\n--- a/Documentation/git-rebase.txt\n+++ b/Documentation/git-rebase.txt\n@@ -368,17 +368,17 @@ By replacing the command \"pick\" with the command \"edit\", you can tell\n the files and/or the commit message, amend the commit, and continue\n rebasing.\n \n-If you just want to edit the commit message for a commit, you can replace\n-the command \"pick\" with the command \"reword\".\n+If you just want to edit the commit message for a commit, replace the\n+command \"pick\" with the command \"reword\".\n \n If you want to fold two or more commits into one, replace the command\n \"pick\" with \"squash\" for the second and subsequent commit.  If the\n commits had different authors, it will attribute the squashed commit to\n the author of the first commit.\n \n-In both cases, or when a \"pick\" does not succeed (because of merge\n-errors), the loop will stop to let you fix things, and you can continue\n-the loop with `git rebase --continue`.\n+'git-rebase' will stop when \"pick\" has been replaced with \"edit\" or\n+when a command fails due to merge errors. When you are done editing\n+and/or resolving conflicts you can continue with `git rebase --continue`.\n \n For example, if you want to reorder the last 5 commits, such that what\n was HEAD~4 becomes the new HEAD. To achieve that, you would call\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 30c2f62..a43ee22 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -760,7 +760,7 @@ first and then run 'git rebase --continue' again.\"\n #\n # Commands:\n #  p, pick = use commit\n-#  r, reword = use commit, but allow editing of the commit message\n+#  r, reword = use commit, but edit the commit message\n #  e, edit = use commit, but stop for amending\n #  s, squash = use commit, but meld into previous commit\n #\n-- \n1.6.5.rc2.18.g020de\n"}]}