]> git.ipfire.org Git - thirdparty/git.git/blame - bisect.h
Merge branch 'en/merge-ort-api-null-impl'
[thirdparty/git.git] / bisect.h
CommitLineData
a2ad79ce
CC
1#ifndef BISECT_H
2#define BISECT_H
ef3ca954
EN
3
4struct commit_list;
69d2cfe6 5struct repository;
a2ad79ce 6
24d707f6
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`.
13 */
55454427 14void find_bisection(struct commit_list **list, int *reaches, int *all,
ad464a4e 15 unsigned bisect_flags);
a2ad79ce 16
55454427 17struct commit_list *filter_skipped(struct commit_list *list,
ad6dad09
DL
18 struct commit_list **tried,
19 int show_all,
20 int *count,
21 int *skipped_first);
95188648 22
37c4c38d 23#define BISECT_SHOW_ALL (1<<0)
98993722 24#define REV_LIST_QUIET (1<<1)
37c4c38d 25
ad464a4e
AL
26#define FIND_BISECTION_ALL (1u<<0)
27#define FIND_BISECTION_FIRST_PARENT_ONLY (1u<<1)
28
d797257e
CC
29struct rev_list_info {
30 struct rev_info *revs;
98993722 31 int flags;
d797257e
CC
32 int show_timestamp;
33 int hdr_termination;
34 const char *header_prefix;
35};
36
680e8a01
MR
37/*
38 * enum bisect_error represents the following return codes:
39 * BISECT_OK: success code. Internally, it means that next
40 * commit has been found (and possibly checked out) and it
41 * should be tested.
42 * BISECT_FAILED error code: default error code.
ce58b5d8
PB
43 * BISECT_ONLY_SKIPPED_LEFT error code: only skipped
44 * commits left to be tested.
6c69f222
PB
45 * BISECT_MERGE_BASE_CHECK error code: merge base check failed.
46 * BISECT_NO_TESTABLE_COMMIT error code: no testable commit found.
47 * BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND early success code:
48 * first term_bad commit found.
cdd4dc2d
PB
49 * BISECT_INTERNAL_SUCCESS_MERGE_BASE early success
50 * code: found merge base that should be tested.
6c69f222
PB
51 * Early success codes BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND and
52 * BISECT_INTERNAL_SUCCESS_MERGE_BASE should be only internal codes.
680e8a01
MR
53 */
54enum bisect_error {
55 BISECT_OK = 0,
ce58b5d8 56 BISECT_FAILED = -1,
cdd4dc2d 57 BISECT_ONLY_SKIPPED_LEFT = -2,
9ec598e0 58 BISECT_MERGE_BASE_CHECK = -3,
6c69f222
PB
59 BISECT_NO_TESTABLE_COMMIT = -4,
60 BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND = -10,
cdd4dc2d 61 BISECT_INTERNAL_SUCCESS_MERGE_BASE = -11
680e8a01
MR
62};
63
be5fe200 64enum bisect_error bisect_next_all(struct repository *r, const char *prefix);
1bf072e3 65
55454427 66int estimate_bisect_steps(int all);
1c876546 67
55454427 68void read_bisect_terms(const char **bad, const char **good);
cb46d630 69
55454427 70int bisect_clean_state(void);
fb71a329 71
a2ad79ce 72#endif