From: Taylor Blau Date: Thu, 30 Apr 2020 19:48:50 GMT Subject: [PATCH v2 2/4] shallow: extract a header file for shallow-related functions Message-ID: <0631e2a87dc83220af27f7be7d7d8cd2bbb117fc.1588275891.git.me@ttaylorr.com> In-Reply-To: There are many functions in commit.h that are more related to shallow repositories than they are to any sort of generic commit machinery. Likely this began when there were only a few shallow-related functions, and commit.h seemed a reasonable enough place to put them. But, now there are a good number of shallow-related functions, and placing them all in 'commit.h' doesn't make sense. This patch extracts a 'shallow.h', which takes all of the declarations from 'commit.h' for functions which already exist in 'shallow.c'. We will bring the remaining shallow-related functions defined in 'commit.c' in a subsequent patch. For now, move only the ones that already are implemented in 'shallow.c', and update the necessary includes. Signed-off-by: Taylor Blau --- builtin/fetch.c | 1 + builtin/pack-objects.c | 1 + builtin/prune.c | 1 + builtin/receive-pack.c | 1 + builtin/repack.c | 1 + builtin/rev-parse.c | 1 + commit-graph.c | 1 + commit.c | 14 +-------- commit.h | 48 ------------------------------- environment.c | 1 + fetch-pack.c | 1 + git.c | 1 + send-pack.c | 1 + shallow.c | 14 +++++++++ shallow.h | 64 ++++++++++++++++++++++++++++++++++++++++++ upload-pack.c | 1 + 16 files changed, 91 insertions(+), 61 deletions(-) create mode 100644 shallow.h diff --git a/builtin/fetch.c b/builtin/fetch.c index bf6bab80fa..a292acd1c0 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -27,6 +27,7 @@ #include "branch.h" #include "promisor-remote.h" #include "commit-graph.h" +#include "shallow.h" #define FORCED_UPDATES_DELAY_WARNING_IN_MS (10 * 1000) diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c index dc7c58ce3f..303ae312a9 100644 --- a/builtin/pack-objects.c +++ b/builtin/pack-objects.c @@ -34,6 +34,7 @@ #include "dir.h" #include "midx.h" #include "trace2.h" +#include "shallow.h" #define IN_PACK(obj) oe_in_pack(&to_pack, obj) #define SIZE(obj) oe_size(&to_pack, obj) diff --git a/builtin/prune.c b/builtin/prune.c index 2b76872ad2..028ff786d6 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -7,6 +7,7 @@ #include "parse-options.h" #include "progress.h" #include "object-store.h" +#include "shallow.h" static const char * const prune_usage[] = { N_("git prune [-n] [-v] [--progress] [--expire