1#ifndef SEQUENCER_H
2#define SEQUENCER_H
3
4const char *git_path_seq_dir(void);
5
6#define APPEND_SIGNOFF_DEDUP (1u << 0)
7
8enum replay_action {
9 REPLAY_REVERT,
10 REPLAY_PICK,
11 REPLAY_INTERACTIVE_REBASE
12};
13
14struct replay_opts {
15 enum replay_action action;
16
17 /* Boolean options */
18 int edit;
19 int record_origin;
20 int no_commit;
21 int signoff;
22 int allow_ff;
23 int allow_rerere_auto;
24 int allow_empty;
25 int allow_empty_message;
26 int keep_redundant_commits;
27 int verbose;
28
29 int mainline;
30
31 char *gpg_sign;
32
33 /* Merge strategy */
34 char *strategy;
35 char **xopts;
36 size_t xopts_nr, xopts_alloc;
37
38 /* Only used by REPLAY_NONE */
39 struct rev_info *revs;
40};
41#define REPLAY_OPTS_INIT { -1 }
42
43int sequencer_pick_revisions(struct replay_opts *opts);
44int sequencer_continue(struct replay_opts *opts);
45int sequencer_rollback(struct replay_opts *opts);
46int sequencer_remove_state(struct replay_opts *opts);
47
48#define TODO_LIST_KEEP_EMPTY (1U << 0)
49#define TODO_LIST_SHORTEN_IDS (1U << 1)
50#define TODO_LIST_ABBREVIATE_CMDS (1U << 2)
51#define TODO_LIST_RECREATE_MERGES (1U << 3)
52/*
53 * When recreating merges, commits that do have the base commit as ancestor
54 * ("cousins") are *not* rebased onto the new base by default. If those
55 * commits should be rebased onto the new base, this flag needs to be passed.
56 */
57#define TODO_LIST_REBASE_COUSINS (1U << 4)
58int sequencer_make_script(FILE *out, int argc, const char **argv,
59 unsigned flags);
60
61int sequencer_add_exec_commands(const char *command);
62int transform_todos(unsigned flags);
63int check_todo_list(void);
64int skip_unnecessary_picks(void);
65int rearrange_squash(void);
66
67extern const char sign_off_header[];
68
69void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag);
70void append_conflicts_hint(struct strbuf *msgbuf);
71
72#endif