2009-03-26 12:55:24 +08:00
|
|
|
#ifndef BISECT_H
|
|
|
|
#define BISECT_H
|
2018-08-16 01:54:05 +08:00
|
|
|
|
|
|
|
struct commit_list;
|
2018-11-10 13:48:59 +08:00
|
|
|
struct repository;
|
2009-03-26 12:55:24 +08:00
|
|
|
|
2017-11-06 04:24:28 +08:00
|
|
|
/*
|
|
|
|
* Find bisection. If something is found, `reaches` will be the number of
|
|
|
|
* commits that the best commit reaches. `all` will be the count of
|
|
|
|
* non-SAMETREE commits. If nothing is found, `list` will be NULL.
|
|
|
|
* Otherwise, it will be either all non-SAMETREE commits or the single
|
|
|
|
* best commit, as chosen by `find_all`.
|
|
|
|
*/
|
2019-04-29 16:28:14 +08:00
|
|
|
void find_bisection(struct commit_list **list, int *reaches, int *all,
|
2019-04-29 16:28:23 +08:00
|
|
|
int find_all);
|
2009-03-26 12:55:24 +08:00
|
|
|
|
2019-04-29 16:28:14 +08:00
|
|
|
struct commit_list *filter_skipped(struct commit_list *list,
|
2019-04-29 16:28:23 +08:00
|
|
|
struct commit_list **tried,
|
|
|
|
int show_all,
|
|
|
|
int *count,
|
|
|
|
int *skipped_first);
|
2009-03-26 12:55:49 +08:00
|
|
|
|
2009-03-29 17:55:43 +08:00
|
|
|
#define BISECT_SHOW_ALL (1<<0)
|
2012-02-28 22:00:00 +08:00
|
|
|
#define REV_LIST_QUIET (1<<1)
|
2009-03-29 17:55:43 +08:00
|
|
|
|
2009-04-07 04:28:00 +08:00
|
|
|
struct rev_list_info {
|
|
|
|
struct rev_info *revs;
|
2012-02-28 22:00:00 +08:00
|
|
|
int flags;
|
2009-04-07 04:28:00 +08:00
|
|
|
int show_timestamp;
|
|
|
|
int hdr_termination;
|
|
|
|
const char *header_prefix;
|
|
|
|
};
|
|
|
|
|
2020-02-17 16:40:32 +08:00
|
|
|
/*
|
|
|
|
* enum bisect_error represents the following return codes:
|
|
|
|
* BISECT_OK: success code. Internally, it means that next
|
|
|
|
* commit has been found (and possibly checked out) and it
|
|
|
|
* should be tested.
|
|
|
|
* BISECT_FAILED error code: default error code.
|
2020-02-17 16:40:34 +08:00
|
|
|
* BISECT_ONLY_SKIPPED_LEFT error code: only skipped
|
|
|
|
* commits left to be tested.
|
2020-02-17 16:40:39 +08:00
|
|
|
* BISECT_MERGE_BASE_CHECK error code: merge base check failed.
|
|
|
|
* BISECT_NO_TESTABLE_COMMIT error code: no testable commit found.
|
|
|
|
* BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND early success code:
|
|
|
|
* first term_bad commit found.
|
2020-02-17 16:40:36 +08:00
|
|
|
* BISECT_INTERNAL_SUCCESS_MERGE_BASE early success
|
|
|
|
* code: found merge base that should be tested.
|
2020-02-17 16:40:39 +08:00
|
|
|
* Early success codes BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND and
|
|
|
|
* BISECT_INTERNAL_SUCCESS_MERGE_BASE should be only internal codes.
|
2020-02-17 16:40:32 +08:00
|
|
|
*/
|
|
|
|
enum bisect_error {
|
|
|
|
BISECT_OK = 0,
|
2020-02-17 16:40:34 +08:00
|
|
|
BISECT_FAILED = -1,
|
2020-02-17 16:40:36 +08:00
|
|
|
BISECT_ONLY_SKIPPED_LEFT = -2,
|
2020-02-17 16:40:38 +08:00
|
|
|
BISECT_MERGE_BASE_CHECK = -3,
|
2020-02-17 16:40:39 +08:00
|
|
|
BISECT_NO_TESTABLE_COMMIT = -4,
|
|
|
|
BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND = -10,
|
2020-02-17 16:40:36 +08:00
|
|
|
BISECT_INTERNAL_SUCCESS_MERGE_BASE = -11
|
2020-02-17 16:40:32 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
enum bisect_error bisect_next_all(struct repository *r,
|
2019-04-29 16:28:23 +08:00
|
|
|
const char *prefix,
|
|
|
|
int no_checkout);
|
2009-03-26 12:55:54 +08:00
|
|
|
|
2019-04-29 16:28:14 +08:00
|
|
|
int estimate_bisect_steps(int all);
|
2009-04-19 17:55:38 +08:00
|
|
|
|
2019-04-29 16:28:14 +08:00
|
|
|
void read_bisect_terms(const char **bad, const char **good);
|
2015-06-29 23:40:30 +08:00
|
|
|
|
2019-04-29 16:28:14 +08:00
|
|
|
int bisect_clean_state(void);
|
2017-09-29 14:49:39 +08:00
|
|
|
|
2009-03-26 12:55:24 +08:00
|
|
|
#endif
|