9 const char *git_path_commit_editmsg(void);
10 const char *git_path_seq_dir(void);
12 #define APPEND_SIGNOFF_DEDUP (1u << 0)
17 REPLAY_INTERACTIVE_REBASE
20 enum commit_msg_cleanup_mode {
21 COMMIT_MSG_CLEANUP_SPACE,
22 COMMIT_MSG_CLEANUP_NONE,
23 COMMIT_MSG_CLEANUP_SCISSORS,
24 COMMIT_MSG_CLEANUP_ALL
28 enum replay_action action;
36 int allow_rerere_auto;
38 int allow_empty_message;
39 int keep_redundant_commits;
45 enum commit_msg_cleanup_mode default_msg_cleanup;
50 size_t xopts_nr, xopts_alloc;
52 /* Used by fixup/squash */
53 struct strbuf current_fixups;
54 int current_fixup_count;
56 /* placeholder commit for -i --root */
57 struct object_id squash_onto;
60 /* Only used by REPLAY_NONE */
61 struct rev_info *revs;
63 #define REPLAY_OPTS_INIT { .action = -1, .current_fixups = STRBUF_INIT }
65 /* Call this to setup defaults before parsing command line options */
66 void sequencer_init_config(struct replay_opts *opts);
67 int sequencer_pick_revisions(struct replay_opts *opts);
68 int sequencer_continue(struct replay_opts *opts);
69 int sequencer_rollback(struct replay_opts *opts);
70 int sequencer_remove_state(struct replay_opts *opts);
72 #define TODO_LIST_KEEP_EMPTY (1U << 0)
73 #define TODO_LIST_SHORTEN_IDS (1U << 1)
74 #define TODO_LIST_ABBREVIATE_CMDS (1U << 2)
75 #define TODO_LIST_REBASE_MERGES (1U << 3)
77 * When rebasing merges, commits that do have the base commit as ancestor
78 * ("cousins") are *not* rebased onto the new base by default. If those
79 * commits should be rebased onto the new base, this flag needs to be passed.
81 #define TODO_LIST_REBASE_COUSINS (1U << 4)
82 int sequencer_make_script(FILE *out, int argc, const char **argv,
85 int sequencer_add_exec_commands(const char *command);
86 int transform_todos(unsigned flags);
87 int check_todo_list(void);
88 int skip_unnecessary_picks(void);
89 int rearrange_squash(void);
91 extern const char sign_off_header[];
94 * Append a signoff to the commit message in "msgbuf". The ignore_footer
95 * parameter specifies the number of bytes at the end of msgbuf that should
96 * not be considered at all. I.e., they are not checked for existing trailers,
97 * and the new signoff will be spliced into the buffer before those bytes.
99 void append_signoff(struct strbuf *msgbuf, size_t ignore_footer, unsigned flag);
101 void append_conflicts_hint(struct strbuf *msgbuf);
102 int message_is_empty(const struct strbuf *sb,
103 enum commit_msg_cleanup_mode cleanup_mode);
104 int template_untouched(const struct strbuf *sb, const char *template_file,
105 enum commit_msg_cleanup_mode cleanup_mode);
106 int update_head_with_reflog(const struct commit *old_head,
107 const struct object_id *new_head,
108 const char *action, const struct strbuf *msg,
110 void commit_post_rewrite(const struct commit *current_head,
111 const struct object_id *new_head);
113 #define SUMMARY_INITIAL_COMMIT (1 << 0)
114 #define SUMMARY_SHOW_AUTHOR_DATE (1 << 1)
115 void print_commit_summary(const char *prefix, const struct object_id *oid,