bisect: libify `check_merge_bases` and its dependents
[git.git] / bisect.h
blobf68ae853766b1f11233d82df7e89f9abd79bfc55
1 #ifndef BISECT_H
2 #define BISECT_H
4 struct commit_list;
5 struct repository;
7 /*
8 * Find bisection. If something is found, `reaches` will be the number of
9 * commits that the best commit reaches. `all` will be the count of
10 * non-SAMETREE commits. If nothing is found, `list` will be NULL.
11 * Otherwise, it will be either all non-SAMETREE commits or the single
12 * best commit, as chosen by `find_all`.
14 void find_bisection(struct commit_list **list, int *reaches, int *all,
15 int find_all);
17 struct commit_list *filter_skipped(struct commit_list *list,
18 struct commit_list **tried,
19 int show_all,
20 int *count,
21 int *skipped_first);
23 #define BISECT_SHOW_ALL (1<<0)
24 #define REV_LIST_QUIET (1<<1)
26 struct rev_list_info {
27 struct rev_info *revs;
28 int flags;
29 int show_timestamp;
30 int hdr_termination;
31 const char *header_prefix;
35 * enum bisect_error represents the following return codes:
36 * BISECT_OK: success code. Internally, it means that next
37 * commit has been found (and possibly checked out) and it
38 * should be tested.
39 * BISECT_FAILED error code: default error code.
40 * BISECT_ONLY_SKIPPED_LEFT error code: only skipped
41 * commits left to be tested.
42 * BISECT_INTERNAL_SUCCESS_MERGE_BASE early success
43 * code: found merge base that should be tested.
44 * Early success code BISECT_INTERNAL_SUCCESS_MERGE_BASE
45 * should be only an internal code.
47 enum bisect_error {
48 BISECT_OK = 0,
49 BISECT_FAILED = -1,
50 BISECT_ONLY_SKIPPED_LEFT = -2,
51 BISECT_INTERNAL_SUCCESS_MERGE_BASE = -11
54 enum bisect_error bisect_next_all(struct repository *r,
55 const char *prefix,
56 int no_checkout);
58 int estimate_bisect_steps(int all);
60 void read_bisect_terms(const char **bad, const char **good);
62 int bisect_clean_state(void);
64 #endif