rebase: cherry-pick: add copyright
[git] / sequencer.h
1 #ifndef SEQUENCER_H
2 #define SEQUENCER_H
3
4 #define SEQ_DIR         "sequencer"
5 #define SEQ_HEAD_FILE   "sequencer/head"
6 #define SEQ_TODO_FILE   "sequencer/todo"
7 #define SEQ_OPTS_FILE   "sequencer/opts"
8 #define SEQ_REWR_FILE   "sequencer/rewritten"
9
10 #define APPEND_SIGNOFF_DEDUP (1u << 0)
11
12 enum replay_action {
13         REPLAY_REVERT,
14         REPLAY_PICK
15 };
16
17 enum replay_subcommand {
18         REPLAY_NONE,
19         REPLAY_REMOVE_STATE,
20         REPLAY_CONTINUE,
21         REPLAY_ROLLBACK,
22         REPLAY_SKIP
23 };
24
25 struct replay_opts {
26         enum replay_action action;
27         enum replay_subcommand subcommand;
28
29         /* Boolean options */
30         int edit;
31         int record_origin;
32         int no_commit;
33         int signoff;
34         int allow_ff;
35         int allow_rerere_auto;
36         int allow_empty;
37         int allow_empty_message;
38         int keep_redundant_commits;
39         int skip_empty;
40         int quiet;
41
42         int mainline;
43
44         /* Merge strategy */
45         const char *strategy;
46         const char **xopts;
47         size_t xopts_nr, xopts_alloc;
48
49         /* Only used by REPLAY_NONE */
50         struct rev_info *revs;
51
52         const char *action_name;
53 };
54
55 int sequencer_pick_revisions(struct replay_opts *opts);
56
57 extern const char sign_off_header[];
58
59 void append_signoff(struct strbuf *msgbuf, int ignore_footer, unsigned flag);
60
61 #endif