Skip to content

Commit 90fdadf

Browse files
committed
sequencer (rebase -i): implement the 'drop' command
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 3dd0ebd commit 90fdadf

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

sequencer.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,8 @@ enum todo_command {
680680
TODO_FIXUP,
681681
TODO_SQUASH,
682682
TODO_EXEC,
683-
TODO_NOOP
683+
TODO_NOOP,
684+
TODO_DROP
684685
};
685686

686687
static struct {
@@ -694,7 +695,8 @@ static struct {
694695
{ 'f', "fixup" },
695696
{ 's', "squash" },
696697
{ 'x', "exec" },
697-
{ 0, "noop" }
698+
{ 0, "noop" },
699+
{ 'd', "drop" }
698700
};
699701

700702
static const char *command_to_string(const enum todo_command command)
@@ -1208,7 +1210,7 @@ static int parse_insn_buffer(char *buf, struct todo_list *todo_list,
12081210
else if (is_fixup(item->command))
12091211
return error("Cannot '%s' without a previous commit",
12101212
command_to_string(item->command));
1211-
else if (item->command != TODO_NOOP)
1213+
else if (item->command < TODO_NOOP)
12121214
fixup_okay = 1;
12131215
p = *eol ? eol + 1 : eol;
12141216
}
@@ -1631,7 +1633,7 @@ static enum todo_command peek_command(struct todo_list *todo_list, int offset)
16311633
int i;
16321634

16331635
for (i = todo_list->current + offset; i < todo_list->nr; i++)
1634-
if (todo_list->items[i].command != TODO_NOOP)
1636+
if (todo_list->items[i].command < TODO_NOOP)
16351637
return todo_list->items[i].command;
16361638

16371639
return -1;
@@ -1717,7 +1719,7 @@ static int pick_commits(struct todo_list *todo_list, struct replay_opts *opts)
17171719
res = do_exec(item->arg);
17181720
*end_of_arg = saved;
17191721
}
1720-
else if (item->command != TODO_NOOP)
1722+
else if (item->command < TODO_NOOP)
17211723
return error("Unknown command %d", item->command);
17221724

17231725
todo_list->current++;

0 commit comments

Comments
 (0)