mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-27 11:47:49 -05:00
The Git project is not exactly the easiest project to get started in: it's written in C and POSIX shell, with bits of Perl, Rust and other languages sprinkled into it. On top of that, the project has grown somewhat organically over time, making the codebase hard to navigate. These are problems that we're aware of, and there have been and still are efforts to clean up some of the technical debt that is natural to exist an a project that is more than 20 years old. Furthermore, we provide resources to newcomers that help them out like our coding guidelines, code of conduct or "MyFirstContribution.adoc". But there is a rather practical problem: finding your way around in our project's tree is not easy. Doing a directory listing in the top-level directory will present you with more than 550 files, which makes it extremely hard for a newcomer to figure out what files they are even supposed to look at. This makes the onboarding experience somewhat harder than it really needs to be. This isn't only a problem for newcomers though, as I myself struggle to find the files I am looking for because of the sheer number of files. Besides the problem of discoverability it also creates a problem of structure. It is not obvious at all which files are part of "libgit.a" and which files are only linked into our final executables. So while we have this split in our build systems, that split is not evident at all in our tree. Introduce a new "lib/" directory and move all of our sources for "libgit.a" into it to fix these issues. It makes the split we have evident and reduces the number of files in our top-level tree from 550 files to ~80 files. This is still a lot of files, but it's significantly easier to navigate already. Furthermore, we can further iterate after this step and think about introducing a better structure for remaining files, as well. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
78 lines
2.3 KiB
C
78 lines
2.3 KiB
C
#ifndef BISECT_H
|
|
#define BISECT_H
|
|
|
|
struct commit_list;
|
|
struct repository;
|
|
struct object_id;
|
|
|
|
/*
|
|
* 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`.
|
|
*/
|
|
void find_bisection(struct commit_list **list, int *reaches, int *all,
|
|
unsigned bisect_flags);
|
|
|
|
struct commit_list *filter_skipped(struct commit_list *list,
|
|
struct commit_list **tried,
|
|
int show_all,
|
|
int *count,
|
|
int *skipped_first);
|
|
|
|
#define BISECT_SHOW_ALL (1<<0)
|
|
#define REV_LIST_QUIET (1<<1)
|
|
|
|
#define FIND_BISECTION_ALL (1u<<0)
|
|
#define FIND_BISECTION_FIRST_PARENT_ONLY (1u<<1)
|
|
|
|
/*
|
|
* 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.
|
|
* BISECT_ONLY_SKIPPED_LEFT error code: only skipped
|
|
* commits left to be tested.
|
|
* 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.
|
|
* BISECT_INTERNAL_SUCCESS_MERGE_BASE early success
|
|
* code: found merge base that should be tested.
|
|
* Early success codes BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND and
|
|
* BISECT_INTERNAL_SUCCESS_MERGE_BASE should be only internal codes.
|
|
*/
|
|
enum bisect_error {
|
|
BISECT_OK = 0,
|
|
BISECT_FAILED = -1,
|
|
BISECT_ONLY_SKIPPED_LEFT = -2,
|
|
BISECT_MERGE_BASE_CHECK = -3,
|
|
BISECT_NO_TESTABLE_COMMIT = -4,
|
|
BISECT_INTERNAL_SUCCESS_1ST_BAD_FOUND = -10,
|
|
BISECT_INTERNAL_SUCCESS_MERGE_BASE = -11
|
|
};
|
|
|
|
/*
|
|
* Stores how many good/bad commits we have stored for a bisect. nr_bad can
|
|
* only be 0 or 1.
|
|
*/
|
|
struct bisect_state {
|
|
unsigned int nr_good;
|
|
unsigned int nr_bad;
|
|
};
|
|
|
|
enum bisect_error bisect_next_all(struct repository *r, const char *prefix);
|
|
|
|
int estimate_bisect_steps(int all);
|
|
|
|
void read_bisect_terms(char **bad, char **good);
|
|
|
|
int bisect_clean_state(void);
|
|
|
|
enum bisect_error bisect_checkout(const struct object_id *bisect_rev,
|
|
int no_checkout);
|
|
|
|
#endif
|