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>
73 lines
1.9 KiB
C
73 lines
1.9 KiB
C
#ifndef CONNECTED_H
|
|
#define CONNECTED_H
|
|
|
|
struct object_id;
|
|
struct transport;
|
|
|
|
/*
|
|
* Take callback data, and return next object name in the buffer.
|
|
* When called after returning the name for the last object, return -1
|
|
* to signal EOF, otherwise return 0.
|
|
*/
|
|
typedef const struct object_id *(*oid_iterate_fn)(void *);
|
|
|
|
/*
|
|
* Named-arguments struct for check_connected. All arguments are
|
|
* optional, and can be left to defaults as set by CHECK_CONNECTED_INIT.
|
|
*/
|
|
struct check_connected_options {
|
|
/* Avoid printing any errors to stderr. */
|
|
int quiet;
|
|
|
|
/* --shallow-file to pass to rev-list sub-process */
|
|
const char *shallow_file;
|
|
|
|
/* Transport whose objects we are checking, if available. */
|
|
struct transport *transport;
|
|
|
|
/*
|
|
* If non-zero, send error messages to this descriptor rather
|
|
* than stderr. The descriptor is closed before check_connected
|
|
* returns.
|
|
*/
|
|
int err_fd;
|
|
|
|
/* If non-zero, show progress as we traverse the objects. */
|
|
int progress;
|
|
|
|
/*
|
|
* Insert these variables into the environment of the child process.
|
|
*/
|
|
const char **env;
|
|
|
|
/*
|
|
* If non-zero, check the ancestry chain completely, not stopping at
|
|
* any existing ref. This is necessary when deepening existing refs
|
|
* during a fetch.
|
|
*/
|
|
unsigned is_deepening_fetch : 1;
|
|
|
|
/*
|
|
* If not NULL, use `--exclude-hidden=$section` to exclude all refs
|
|
* hidden via the `$section.hideRefs` config from the set of
|
|
* already-reachable refs.
|
|
*/
|
|
const char *exclude_hidden_refs_section;
|
|
};
|
|
|
|
#define CHECK_CONNECTED_INIT { 0 }
|
|
|
|
/*
|
|
* Make sure that all given objects and all objects reachable from them
|
|
* either exist in our object store or (if the repository is a partial
|
|
* clone) are promised to be available.
|
|
*
|
|
* Return 0 if Ok, non zero otherwise (i.e. some missing objects)
|
|
*
|
|
* If "opt" is NULL, behaves as if CHECK_CONNECTED_INIT was passed.
|
|
*/
|
|
int check_connected(oid_iterate_fn fn, void *cb_data,
|
|
struct check_connected_options *opt);
|
|
|
|
#endif /* CONNECTED_H */
|