This is now trivial, as all the building blocks are in place: all we need
to do is to flip the "edit" switch when committing.

Signed-off-by: Johannes Schindelin <johannes.schinde...@gmx.de>
---
 sequencer.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/sequencer.c b/sequencer.c
index 9a06b40..64fec47 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -746,6 +746,7 @@ enum todo_command {
        TODO_PICK,
        TODO_REVERT,
        TODO_EDIT,
+       TODO_REWORD,
        TODO_FIXUP,
        TODO_SQUASH,
        TODO_EXEC,
@@ -759,6 +760,7 @@ static struct {
        { 'p', "pick" },
        { 0,   "revert" },
        { 'e', "edit" },
+       { 'r', "reword" },
        { 'f', "fixup" },
        { 's', "squash" },
        { 'x', "exec" },
@@ -1004,7 +1006,9 @@ static int do_pick_commit(enum todo_command command, 
struct commit *commit,
                }
        }
 
-       if (is_fixup(command)) {
+       if (command == TODO_REWORD)
+               edit = 1;
+       else if (is_fixup(command)) {
                if (update_squash_messages(command, commit, opts))
                        return -1;
                amend = 1;
@@ -1755,7 +1759,8 @@ static int pick_commits(struct todo_list *todo_list, 
struct replay_opts *opts)
                        }
                        else if (res && is_rebase_i(opts))
                                return res | error_with_patch(item->commit,
-                                       item->arg, item->arg_len, opts, res, 0);
+                                       item->arg, item->arg_len, opts, res,
+                                       item->command == TODO_REWORD);
                }
                else if (item->command == TODO_EXEC) {
                        char *end_of_arg = (char *)(item->arg + item->arg_len);
-- 
2.10.0.rc2.102.g5c102ec


Reply via email to