]>
Commit | Line | Data |
---|---|---|
a2ad79ce CC |
1 | #ifndef BISECT_H |
2 | #define BISECT_H | |
ef3ca954 EN |
3 | |
4 | struct commit_list; | |
69d2cfe6 | 5 | struct repository; |
48af1fde | 6 | struct object_id; |
a2ad79ce | 7 | |
24d707f6 MÅ |
8 | /* |
9 | * Find bisection. If something is found, `reaches` will be the number of | |
10 | * commits that the best commit reaches. `all` will be the count of | |
11 | * non-SAMETREE commits. If nothing is found, `list` will be NULL. | |
12 | * Otherwise, it will be either all non-SAMETREE commits or the single | |
13 | * best commit, as chosen by `find_all`. | |
14 | */ | |
55454427 | 15 | void find_bisection(struct commit_list **list, int *reaches, int *all, |
ad464a4e | 16 | unsigned bisect_flags); |
a2ad79ce | 17 | |
55454427 | 18 | struct commit_list *filter_skipped(struct commit_list *list, |
ad6dad09 DL |
19 | struct commit_list **tried, |
20 | int show_all, | |
21 | int *count, | |
22 | int *skipped_first); | |
95188648 | 23 | |
37c4c38d | 24 | #define BISECT_SHOW_ALL (1<<0) |
98993722 | 25 | #define REV_LIST_QUIET (1<<1) |
37c4c38d | 26 | |
ad464a4e AL |
27 | #define FIND_BISECTION_ALL (1u<<0) |
28 | #define FIND_BISECTION_FIRST_PARENT_ONLY (1u<<1) | |
29 | ||
d797257e CC |
30 | struct rev_list_info { |
31 | struct rev_info *revs; | |
98993722 | 32 | int flags; |
d797257e CC |
33 | int show_timestamp; |
34 | int hdr_termination; | |
35 | const char *header_prefix; | |
36 | }; | |
37 | ||
680e8a01 MR |
38 | /* |
39 | * enum bisect_error represents the following return codes: | |
40 | * BISECT_OK: success code. Internally, it means that next | |
41 | * commit has been found (and possibly checked out) and it | |
42 | * should be tested. | |
43 | * BISECT_FAILED error code: default error code. | |
ce58b5d8 PB |
44 | * BISECT_ONLY_SKIPPED_LEFT error code: only skipped |
45 | * commits left to be tested. | |
6c69f222 PB |
46 | * BISECT_MERGE_BASE_CHECK error code: merge base check failed. |
47 | * BISECT_NO_TESTABLE_COMMIT error code: no testable commit found. | |
48 | * BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND early success code: | |
49 | * first term_bad commit found. | |
cdd4dc2d PB |
50 | * BISECT_INTERNAL_SUCCESS_MERGE_BASE early success |
51 | * code: found merge base that should be tested. | |
6c69f222 PB |
52 | * Early success codes BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND and |
53 | * BISECT_INTERNAL_SUCCESS_MERGE_BASE should be only internal codes. | |
680e8a01 MR |
54 | */ |
55 | enum bisect_error { | |
56 | BISECT_OK = 0, | |
ce58b5d8 | 57 | BISECT_FAILED = -1, |
cdd4dc2d | 58 | BISECT_ONLY_SKIPPED_LEFT = -2, |
9ec598e0 | 59 | BISECT_MERGE_BASE_CHECK = -3, |
6c69f222 PB |
60 | BISECT_NO_TESTABLE_COMMIT = -4, |
61 | BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND = -10, | |
cdd4dc2d | 62 | BISECT_INTERNAL_SUCCESS_MERGE_BASE = -11 |
680e8a01 MR |
63 | }; |
64 | ||
0cf1defa CD |
65 | /* |
66 | * Stores how many good/bad commits we have stored for a bisect. nr_bad can | |
67 | * only be 0 or 1. | |
68 | */ | |
69 | struct bisect_state { | |
70 | unsigned int nr_good; | |
71 | unsigned int nr_bad; | |
72 | }; | |
73 | ||
be5fe200 | 74 | enum bisect_error bisect_next_all(struct repository *r, const char *prefix); |
1bf072e3 | 75 | |
55454427 | 76 | int estimate_bisect_steps(int all); |
1c876546 | 77 | |
55454427 | 78 | void read_bisect_terms(const char **bad, const char **good); |
cb46d630 | 79 | |
55454427 | 80 | int bisect_clean_state(void); |
fb71a329 | 81 | |
48af1fde RS |
82 | enum bisect_error bisect_checkout(const struct object_id *bisect_rev, |
83 | int no_checkout); | |
84 | ||
a2ad79ce | 85 | #endif |