bisect.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef BISECT_H
  2. #define BISECT_H
  3. struct commit_list;
  4. struct repository;
  5. /*
  6. * Find bisection. If something is found, `reaches` will be the number of
  7. * commits that the best commit reaches. `all` will be the count of
  8. * non-SAMETREE commits. If nothing is found, `list` will be NULL.
  9. * Otherwise, it will be either all non-SAMETREE commits or the single
  10. * best commit, as chosen by `find_all`.
  11. */
  12. void find_bisection(struct commit_list **list, int *reaches, int *all,
  13. unsigned bisect_flags);
  14. struct commit_list *filter_skipped(struct commit_list *list,
  15. struct commit_list **tried,
  16. int show_all,
  17. int *count,
  18. int *skipped_first);
  19. #define BISECT_SHOW_ALL (1<<0)
  20. #define REV_LIST_QUIET (1<<1)
  21. #define FIND_BISECTION_ALL (1u<<0)
  22. #define FIND_BISECTION_FIRST_PARENT_ONLY (1u<<1)
  23. struct rev_list_info {
  24. struct rev_info *revs;
  25. int flags;
  26. int show_timestamp;
  27. int hdr_termination;
  28. const char *header_prefix;
  29. };
  30. /*
  31. * enum bisect_error represents the following return codes:
  32. * BISECT_OK: success code. Internally, it means that next
  33. * commit has been found (and possibly checked out) and it
  34. * should be tested.
  35. * BISECT_FAILED error code: default error code.
  36. * BISECT_ONLY_SKIPPED_LEFT error code: only skipped
  37. * commits left to be tested.
  38. * BISECT_MERGE_BASE_CHECK error code: merge base check failed.
  39. * BISECT_NO_TESTABLE_COMMIT error code: no testable commit found.
  40. * BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND early success code:
  41. * first term_bad commit found.
  42. * BISECT_INTERNAL_SUCCESS_MERGE_BASE early success
  43. * code: found merge base that should be tested.
  44. * Early success codes BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND and
  45. * BISECT_INTERNAL_SUCCESS_MERGE_BASE should be only internal codes.
  46. */
  47. enum bisect_error {
  48. BISECT_OK = 0,
  49. BISECT_FAILED = -1,
  50. BISECT_ONLY_SKIPPED_LEFT = -2,
  51. BISECT_MERGE_BASE_CHECK = -3,
  52. BISECT_NO_TESTABLE_COMMIT = -4,
  53. BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND = -10,
  54. BISECT_INTERNAL_SUCCESS_MERGE_BASE = -11
  55. };
  56. enum bisect_error bisect_next_all(struct repository *r, const char *prefix);
  57. int estimate_bisect_steps(int all);
  58. void read_bisect_terms(const char **bad, const char **good);
  59. int bisect_clean_state(void);
  60. #endif