sequencer: make the todo_list structure public
This makes the structures todo_list and todo_item, and the functions todo_list_release() and parse_insn_buffer(), accessible outside of sequencer.c. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2b71595d47
commit
5d94d54564
50
sequencer.h
50
sequencer.h
@@ -73,6 +73,56 @@ enum missing_commit_check_level {
|
||||
int write_message(const void *buf, size_t len, const char *filename,
|
||||
int append_eol);
|
||||
|
||||
/*
|
||||
* Note that ordering matters in this enum. Not only must it match the mapping
|
||||
* of todo_command_info (in sequencer.c), it is also divided into several
|
||||
* sections that matter. When adding new commands, make sure you add it in the
|
||||
* right section.
|
||||
*/
|
||||
enum todo_command {
|
||||
/* commands that handle commits */
|
||||
TODO_PICK = 0,
|
||||
TODO_REVERT,
|
||||
TODO_EDIT,
|
||||
TODO_REWORD,
|
||||
TODO_FIXUP,
|
||||
TODO_SQUASH,
|
||||
/* commands that do something else than handling a single commit */
|
||||
TODO_EXEC,
|
||||
TODO_BREAK,
|
||||
TODO_LABEL,
|
||||
TODO_RESET,
|
||||
TODO_MERGE,
|
||||
/* commands that do nothing but are counted for reporting progress */
|
||||
TODO_NOOP,
|
||||
TODO_DROP,
|
||||
/* comments (not counted for reporting progress) */
|
||||
TODO_COMMENT
|
||||
};
|
||||
|
||||
struct todo_item {
|
||||
enum todo_command command;
|
||||
struct commit *commit;
|
||||
unsigned int flags;
|
||||
const char *arg;
|
||||
int arg_len;
|
||||
size_t offset_in_buf;
|
||||
};
|
||||
|
||||
struct todo_list {
|
||||
struct strbuf buf;
|
||||
struct todo_item *items;
|
||||
int nr, alloc, current;
|
||||
int done_nr, total_nr;
|
||||
struct stat_data stat;
|
||||
};
|
||||
|
||||
#define TODO_LIST_INIT { STRBUF_INIT }
|
||||
|
||||
int todo_list_parse_insn_buffer(struct repository *r, char *buf,
|
||||
struct todo_list *todo_list);
|
||||
void todo_list_release(struct todo_list *todo_list);
|
||||
|
||||
/* Call this to setup defaults before parsing command line options */
|
||||
void sequencer_init_config(struct replay_opts *opts);
|
||||
int sequencer_pick_revisions(struct repository *repo,
|
||||
|
||||
Reference in New Issue
Block a user