Skip to content

Commit ad7a43f

Browse files
committed
sequencer (rebase -i): implement the 'reword' command
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent f7e56ef commit ad7a43f

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

sequencer.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ enum todo_command {
663663
TODO_PICK,
664664
TODO_REVERT,
665665
TODO_EDIT,
666+
TODO_REWORD,
666667
TODO_FIXUP,
667668
TODO_SQUASH,
668669
TODO_EXEC,
@@ -676,6 +677,7 @@ static struct {
676677
{ 'p', "pick" },
677678
{ 0, "revert" },
678679
{ 'e', "edit" },
680+
{ 'r', "reword" },
679681
{ 'f', "fixup" },
680682
{ 's', "squash" },
681683
{ 'x', "exec" },
@@ -853,7 +855,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
853855
else
854856
parent = commit->parents->item;
855857

856-
if (opts->allow_ff && !is_fixup(command) &&
858+
if (opts->allow_ff && !is_fixup(command) && command != TODO_REWORD &&
857859
((parent && !hashcmp(parent->object.oid.hash, head)) ||
858860
(!parent && unborn)))
859861
fast_forward = 1;
@@ -922,7 +924,9 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
922924
}
923925
}
924926

925-
if (is_fixup(command)) {
927+
if (command == TODO_REWORD)
928+
edit = 1;
929+
else if (is_fixup(command)) {
926930
/* TODO: reflog action */
927931
if (update_squash_messages(command, commit, opts))
928932
return -1;

0 commit comments

Comments
 (0)