#include "config.h"
#include "parse-options.h"
#include "sequencer.h"
+#include "rebase-interactive.h"
static const char * const builtin_rebase_helper_usage[] = {
N_("git rebase--helper [<options>]"),
enum {
CONTINUE = 1, ABORT, MAKE_SCRIPT, SHORTEN_OIDS, EXPAND_OIDS,
CHECK_TODO_LIST, SKIP_UNNECESSARY_PICKS, REARRANGE_SQUASH,
- ADD_EXEC
+ ADD_EXEC, APPEND_TODO_HELP, EDIT_TODO, PREPARE_BRANCH,
+ CHECKOUT_ONTO
} command = 0;
struct option options[] = {
OPT_BOOL(0, "ff", &opts.allow_ff, N_("allow fast-forward")),
OPT_BOOL(0, "rebase-merges", &rebase_merges, N_("rebase merge commits")),
OPT_BOOL(0, "rebase-cousins", &rebase_cousins,
N_("keep original branch points of cousins")),
+ OPT__VERBOSE(&opts.verbose, N_("be verbose")),
OPT_CMDMODE(0, "continue", &command, N_("continue rebase"),
CONTINUE),
OPT_CMDMODE(0, "abort", &command, N_("abort rebase"),
N_("rearrange fixup/squash lines"), REARRANGE_SQUASH),
OPT_CMDMODE(0, "add-exec-commands", &command,
N_("insert exec commands in todo list"), ADD_EXEC),
+ OPT_CMDMODE(0, "append-todo-help", &command,
+ N_("insert the help in the todo list"), APPEND_TODO_HELP),
+ OPT_CMDMODE(0, "edit-todo", &command,
+ N_("edit the todo list during an interactive rebase"),
+ EDIT_TODO),
+ OPT_CMDMODE(0, "prepare-branch", &command,
+ N_("prepare the branch to be rebased"), PREPARE_BRANCH),
+ OPT_CMDMODE(0, "checkout-onto", &command,
+ N_("checkout a commit"), CHECKOUT_ONTO),
OPT_END()
};
return !!rearrange_squash();
if (command == ADD_EXEC && argc == 2)
return !!sequencer_add_exec_commands(argv[1]);
+ if (command == APPEND_TODO_HELP && argc == 1)
+ return !!append_todo_help_to_file(0, keep_empty);
+ if (command == EDIT_TODO && argc == 1)
+ return !!edit_todo_list(flags);
+ if (command == PREPARE_BRANCH && argc == 2)
+ return !!prepare_branch_to_be_rebased(&opts, argv[1]);
+ if (command == CHECKOUT_ONTO && argc == 4)
+ return !!checkout_onto(&opts, argv[1], argv[2], argv[3]);
usage_with_options(builtin_rebase_helper_usage, options);
}