3
#include "config.h"
4
#include "parse-options.h"
5
#include "sequencer.h"
6
+#include "rebase-interactive.h"
7
8
static const char * const builtin_rebase_helper_usage[] = {
9
N_("git rebase--helper [<options>]"),
13
int cmd_rebase__helper(int argc, const char **argv, const char *prefix)
14
{
15
struct replay_opts opts = REPLAY_OPTS_INIT;
15
- unsigned flags = 0, keep_empty = 0, rebase_merges = 0;
16
+ unsigned flags = 0, keep_empty = 0, rebase_merges = 0, write_edit_todo = 0;
17
int abbreviate_commands = 0, rebase_cousins = -1;
18
enum {
19
CONTINUE = 1, ABORT, MAKE_SCRIPT, SHORTEN_OIDS, EXPAND_OIDS,
20
CHECK_TODO_LIST, SKIP_UNNECESSARY_PICKS, REARRANGE_SQUASH,
20
- ADD_EXEC
21
+ ADD_EXEC, APPEND_TODO_HELP
22
} command = 0;
23
struct option options[] = {
24
OPT_BOOL(0, "ff", &opts.allow_ff, N_("allow fast-forward")),
28
OPT_BOOL(0, "rebase-merges", &rebase_merges, N_("rebase merge commits")),
29
OPT_BOOL(0, "rebase-cousins", &rebase_cousins,
30
N_("keep original branch points of cousins")),
31
+ OPT_BOOL(0, "write-edit-todo", &write_edit_todo,
32
+ N_("append the edit-todo message to the todo-list")),
33
OPT_CMDMODE(0, "continue", &command, N_("continue rebase"),
34
CONTINUE),
35
OPT_CMDMODE(0, "abort", &command, N_("abort rebase"),
48
N_("rearrange fixup/squash lines"), REARRANGE_SQUASH),
49
OPT_CMDMODE(0, "add-exec-commands", &command,
50
N_("insert exec commands in todo list"), ADD_EXEC),
51
+ OPT_CMDMODE(0, "append-todo-help", &command,
52
+ N_("insert the help in the todo list"), APPEND_TODO_HELP),
53
OPT_END()
54
};
55
89
return !!rearrange_squash();
90
if (command == ADD_EXEC && argc == 2)
91
return !!sequencer_add_exec_commands(argv[1]);
92
+ if (command == APPEND_TODO_HELP && argc == 1)
93
+ return !!append_todo_help(write_edit_todo, keep_empty);
94
usage_with_options(builtin_rebase_helper_usage, options);
95
}