commit.h: reduce unnecessary includes
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Elijah Newren committed
Apr 22, 2023 at 20:17 UTC
d4a4f9291d63b48b368f79bce3151bee9ca28009
35 files changed
+39
-7
add-interactive.c
+1
index 757a9929d4..de877ca052 100644
--- a/add-interactive.c
+++ b/add-interactive.c
@@ -12,6 +12,7 @@
#include "dir.h"
#include "run-command.h"
#include "prompt.h"
+#include "tree.h"
static void init_color(struct repository *r, struct add_i_state *s,
const char *section_and_slot, char *dst,
archive.c
+2
index ab8966d73a..6226e16b25 100644
--- a/archive.c
+++ b/archive.c
@@ -6,10 +6,12 @@
#include "environment.h"
#include "gettext.h"
#include "hex.h"
+#include "pretty.h"
#include "setup.h"
#include "refs.h"
#include "object-store.h"
#include "commit.h"
+#include "tree.h"
#include "tree-walk.h"
#include "attr.h"
#include "archive.h"
bloom.c
+1
index d0730525da..aef6b5fea2 100644
--- a/bloom.c
+++ b/bloom.c
@@ -6,6 +6,7 @@
#include "hashmap.h"
#include "commit-graph.h"
#include "commit.h"
+#include "commit-slab.h"
define_commit_slab(bloom_filter_slab, struct bloom_filter);
builtin/diff-tree.c
+1
index 385c2d0230..0b02c62b85 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -9,6 +9,7 @@
#include "builtin.h"
#include "submodule.h"
#include "repository.h"
+#include "tree.h"
static struct rev_info log_tree_opt;
builtin/diff.c
+1
index 8f386535d6..457dee1445 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -22,6 +22,7 @@
#include "setup.h"
#include "submodule.h"
#include "oid-array.h"
+#include "tree.h"
#define DIFF_NO_INDEX_EXPLICIT 1
#define DIFF_NO_INDEX_IMPLICIT 2
builtin/gc.c
+1
index b95154fba1..d11712b144 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -12,6 +12,7 @@
#include "builtin.h"
#include "abspath.h"
+#include "date.h"
#include "environment.h"
#include "hex.h"
#include "repository.h"
builtin/log.c
+1
index 95de51921f..137b84b31e 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -44,6 +44,7 @@
#include "commit-reach.h"
#include "range-diff.h"
#include "tmp-objdir.h"
+#include "tree.h"
#include "write-or-die.h"
#define MAIL_DEFAULT_WRAP 72
builtin/merge-tree.c
+1
index 6b9f006ec1..aa8040c2a6 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -16,6 +16,7 @@
#include "exec-cmd.h"
#include "merge-blobs.h"
#include "quote.h"
+#include "tree.h"
static int line_termination = '\n';
combine-diff.c
+1
index f8d6196577..1e3cd7fb17 100644
--- a/combine-diff.c
+++ b/combine-diff.c
@@ -13,6 +13,7 @@
#include "xdiff/xmacros.h"
#include "log-tree.h"
#include "refs.h"
+#include "tree.h"
#include "userdiff.h"
#include "oid-array.h"
#include "revision.h"
commit-graph.c
+1
index 0c4f226644..6f612f368b 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -23,6 +23,7 @@
#include "shallow.h"
#include "json-writer.h"
#include "trace2.h"
+#include "tree.h"
#include "chunk-format.h"
#include "wrapper.h"
commit.c
+1
index 878b4473e4..10676165a1 100644
--- a/commit.c
+++ b/commit.c
@@ -26,6 +26,7 @@
#include "run-command.h"
#include "setup.h"
#include "shallow.h"
+#include "tree.h"
#include "hook.h"
static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);
commit.h
+4
-7
index 69b2f376e9..28928833c5 100644
--- a/commit.h
+++ b/commit.h
@@ -2,13 +2,10 @@
#define COMMIT_H
#include "object.h"
-#include "tree.h"
-#include "strbuf.h"
-#include "decorate.h"
-#include "gpg-interface.h"
-#include "string-list.h"
-#include "pretty.h"
-#include "commit-slab.h"
+
+struct signature_check;
+struct strbuf;
+struct tree;
#define COMMIT_NOT_FROM_GRAPH 0xFFFFFFFF
#define GENERATION_NUMBER_INFINITY ((1ULL << 63) - 1)
dir.c
+1
index ed262fa6e4..a7469df3ac 100644
--- a/dir.c
+++ b/dir.c
@@ -27,6 +27,7 @@
#include "submodule-config.h"
#include "symlinks.h"
#include "trace2.h"
+#include "tree.h"
#include "wrapper.h"
/*
fetch-pack.c
+1
index 677102465a..a9745bd9fa 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -2,6 +2,7 @@
#include "alloc.h"
#include "repository.h"
#include "config.h"
+#include "date.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
fsck.c
+1
index adbe8bf59e..3261ef9ec2 100644
--- a/fsck.c
+++ b/fsck.c
@@ -1,5 +1,6 @@
#include "git-compat-util.h"
#include "alloc.h"
+#include "date.h"
#include "hex.h"
#include "object-store.h"
#include "repository.h"
gpg-interface.c
+1
index 8615dcd4b4..49d72c2066 100644
--- a/gpg-interface.c
+++ b/gpg-interface.c
@@ -1,6 +1,7 @@
#include "git-compat-util.h"
#include "commit.h"
#include "config.h"
+#include "date.h"
#include "gettext.h"
#include "run-command.h"
#include "strbuf.h"
grep.c
+1
index d144b37489..e620e375b1 100644
--- a/grep.c
+++ b/grep.c
@@ -4,6 +4,7 @@
#include "grep.h"
#include "hex.h"
#include "object-store.h"
+#include "pretty.h"
#include "userdiff.h"
#include "xdiff-interface.h"
#include "diff.h"
http-push.c
+1
index 637a4e91f7..3f18498636 100644
--- a/http-push.c
+++ b/http-push.c
@@ -15,6 +15,7 @@
#include "setup.h"
#include "sigchain.h"
#include "strvec.h"
+#include "tree.h"
#include "packfile.h"
#include "object-store.h"
#include "commit-reach.h"
log-tree.c
+1
index b5cf3d8439..8861900b59 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -24,6 +24,7 @@
#include "help.h"
#include "range-diff.h"
#include "strmap.h"
+#include "tree.h"
#include "write-or-die.h"
static struct decoration name_decoration = { "object names" };
merge-ort-wrappers.c
+1
index 2c47c5a623..a550753300 100644
--- a/merge-ort-wrappers.c
+++ b/merge-ort-wrappers.c
@@ -3,6 +3,7 @@
#include "hash.h"
#include "merge-ort.h"
#include "merge-ort-wrappers.h"
+#include "tree.h"
#include "commit.h"
merge.c
+1
index da7fa652c2..10aaec3a6c 100644
--- a/merge.c
+++ b/merge.c
@@ -7,6 +7,7 @@
#include "commit.h"
#include "run-command.h"
#include "resolve-undo.h"
+#include "tree.h"
#include "tree-walk.h"
#include "unpack-trees.h"
#include "dir.h"
notes-cache.c
+1
index fbcdfd0dfe..14288caf98 100644
--- a/notes-cache.c
+++ b/notes-cache.c
@@ -1,6 +1,7 @@
#include "git-compat-util.h"
#include "notes-cache.h"
#include "object-store.h"
+#include "pretty.h"
#include "repository.h"
#include "commit.h"
#include "refs.h"
notes-utils.c
+1
index cb88171b7b..4a793eb347 100644
--- a/notes-utils.c
+++ b/notes-utils.c
@@ -6,6 +6,7 @@
#include "refs.h"
#include "notes-utils.h"
#include "repository.h"
+#include "strbuf.h"
void create_notes_commit(struct repository *r,
struct notes_tree *t,
object-name.c
+1
index 3cd5b32729..5ccbe854b6 100644
--- a/object-name.c
+++ b/object-name.c
@@ -15,6 +15,7 @@
#include "dir.h"
#include "oid-array.h"
#include "packfile.h"
+#include "pretty.h"
#include "object-store.h"
#include "repository.h"
#include "setup.h"
pack-bitmap-write.c
+1
index faf67c94d3..3d3fd38065 100644
--- a/pack-bitmap-write.c
+++ b/pack-bitmap-write.c
@@ -18,6 +18,7 @@
#include "commit-reach.h"
#include "prio-queue.h"
#include "trace2.h"
+#include "tree.h"
struct bitmapped_commit {
struct commit *commit;
parse-options-cb.c
+1
index 26a4c7d08a..be81158f86 100644
--- a/parse-options-cb.c
+++ b/parse-options-cb.c
@@ -3,6 +3,7 @@
#include "branch.h"
#include "commit.h"
#include "color.h"
+#include "date.h"
#include "environment.h"
#include "gettext.h"
#include "object-name.h"
parse-options.c
+1
index b6803647d0..f8a155ee13 100644
--- a/parse-options.c
+++ b/parse-options.c
@@ -5,6 +5,7 @@
#include "commit.h"
#include "color.h"
#include "gettext.h"
+#include "strbuf.h"
#include "utf8.h"
static int disallow_abbreviated_options;
read-cache.c
+1
index b3e2917ddc..d64d93bc36 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -6,6 +6,7 @@
#include "cache.h"
#include "alloc.h"
#include "config.h"
+#include "date.h"
#include "diff.h"
#include "diffcore.h"
#include "hex.h"
ref-filter.c
+1
index 594e66ad36..84eee904ba 100644
--- a/ref-filter.c
+++ b/ref-filter.c
@@ -2,6 +2,7 @@
#include "alloc.h"
#include "environment.h"
#include "gettext.h"
+#include "gpg-interface.h"
#include "hex.h"
#include "parse-options.h"
#include "refs.h"
reflog.c
+1
index 9c09443088..57dc7c0d05 100644
--- a/reflog.c
+++ b/reflog.c
@@ -4,6 +4,7 @@
#include "reflog.h"
#include "refs.h"
#include "revision.h"
+#include "tree.h"
#include "worktree.h"
/* Remember to update object flag allocation in object.h */
refs/debug.c
+1
index adc34c836f..6f11e6de46 100644
--- a/refs/debug.c
+++ b/refs/debug.c
@@ -1,6 +1,7 @@
#include "git-compat-util.h"
#include "hex.h"
#include "refs-internal.h"
+#include "string-list.h"
#include "trace.h"
static struct trace_key trace_refs = TRACE_KEY_INIT(REFS);
refspec.c
+1
index 31b61d782c..57f6c2aaf9 100644
--- a/refspec.c
+++ b/refspec.c
@@ -6,6 +6,7 @@
#include "strvec.h"
#include "refs.h"
#include "refspec.h"
+#include "strbuf.h"
static struct refspec_item s_tag_refspec = {
.force = 0,
revision.h
+1
index 742700504a..6630bb2eae 100644
--- a/revision.h
+++ b/revision.h
@@ -8,6 +8,7 @@
#include "pretty.h"
#include "diff.h"
#include "commit-slab-decl.h"
+#include "decorate.h"
#include "ident.h"
#include "list-objects-filter-options.h"
send-pack.c
+1
index 351037b07b..e68da24cc5 100644
--- a/send-pack.c
+++ b/send-pack.c
@@ -1,6 +1,7 @@
#include "git-compat-util.h"
#include "config.h"
#include "commit.h"
+#include "date.h"
#include "gettext.h"
#include "hex.h"
#include "refs.h"
wt-status.c
+1
index 97b9c1c035..068b76ef6d 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -22,6 +22,7 @@
#include "strbuf.h"
#include "trace.h"
#include "trace2.h"
+#include "tree.h"
#include "utf8.h"
#include "worktree.h"
#include "lockfile.h"