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
@@ -12,6 +12,7 @@
12 #include "dir.h"
13 #include "run-command.h"
14 #include "prompt.h"
15 +#include "tree.h"
16
17 static void init_color(struct repository *r, struct add_i_state *s,
18 const char *section_and_slot, char *dst,
archive.c
+2
@@ -6,10 +6,12 @@
6 #include "environment.h"
7 #include "gettext.h"
8 #include "hex.h"
9 +#include "pretty.h"
10 #include "setup.h"
11 #include "refs.h"
12 #include "object-store.h"
13 #include "commit.h"
14 +#include "tree.h"
15 #include "tree-walk.h"
16 #include "attr.h"
17 #include "archive.h"
bloom.c
+1
@@ -6,6 +6,7 @@
6 #include "hashmap.h"
7 #include "commit-graph.h"
8 #include "commit.h"
9 +#include "commit-slab.h"
10
11 define_commit_slab(bloom_filter_slab, struct bloom_filter);
12
builtin/diff-tree.c
+1
@@ -9,6 +9,7 @@
9 #include "builtin.h"
10 #include "submodule.h"
11 #include "repository.h"
12 +#include "tree.h"
13
14 static struct rev_info log_tree_opt;
15
builtin/diff.c
+1
@@ -22,6 +22,7 @@
22 #include "setup.h"
23 #include "submodule.h"
24 #include "oid-array.h"
25 +#include "tree.h"
26
27 #define DIFF_NO_INDEX_EXPLICIT 1
28 #define DIFF_NO_INDEX_IMPLICIT 2
builtin/gc.c
+1
@@ -12,6 +12,7 @@
12
13 #include "builtin.h"
14 #include "abspath.h"
15 +#include "date.h"
16 #include "environment.h"
17 #include "hex.h"
18 #include "repository.h"
builtin/log.c
+1
@@ -44,6 +44,7 @@
44 #include "commit-reach.h"
45 #include "range-diff.h"
46 #include "tmp-objdir.h"
47 +#include "tree.h"
48 #include "write-or-die.h"
49
50 #define MAIL_DEFAULT_WRAP 72
builtin/merge-tree.c
+1
@@ -16,6 +16,7 @@
16 #include "exec-cmd.h"
17 #include "merge-blobs.h"
18 #include "quote.h"
19 +#include "tree.h"
20
21 static int line_termination = '\n';
22
combine-diff.c
+1
@@ -13,6 +13,7 @@
13 #include "xdiff/xmacros.h"
14 #include "log-tree.h"
15 #include "refs.h"
16 +#include "tree.h"
17 #include "userdiff.h"
18 #include "oid-array.h"
19 #include "revision.h"
commit-graph.c
+1
@@ -23,6 +23,7 @@
23 #include "shallow.h"
24 #include "json-writer.h"
25 #include "trace2.h"
26 +#include "tree.h"
27 #include "chunk-format.h"
28 #include "wrapper.h"
29
commit.c
+1
@@ -26,6 +26,7 @@
26 #include "run-command.h"
27 #include "setup.h"
28 #include "shallow.h"
29 +#include "tree.h"
30 #include "hook.h"
31
32 static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);
commit.h
+4 -7
@@ -2,13 +2,10 @@
2 #define COMMIT_H
3
4 #include "object.h"
5 -#include "tree.h"
6 -#include "strbuf.h"
7 -#include "decorate.h"
8 -#include "gpg-interface.h"
9 -#include "string-list.h"
10 -#include "pretty.h"
11 -#include "commit-slab.h"
5 +
6 +struct signature_check;
7 +struct strbuf;
8 +struct tree;
9
10 #define COMMIT_NOT_FROM_GRAPH 0xFFFFFFFF
11 #define GENERATION_NUMBER_INFINITY ((1ULL << 63) - 1)
dir.c
+1
@@ -27,6 +27,7 @@
27 #include "submodule-config.h"
28 #include "symlinks.h"
29 #include "trace2.h"
30 +#include "tree.h"
31 #include "wrapper.h"
32
33 /*
fetch-pack.c
+1
@@ -2,6 +2,7 @@
2 #include "alloc.h"
3 #include "repository.h"
4 #include "config.h"
5 +#include "date.h"
6 #include "environment.h"
7 #include "gettext.h"
8 #include "hex.h"
fsck.c
+1
@@ -1,5 +1,6 @@
1 #include "git-compat-util.h"
2 #include "alloc.h"
3 +#include "date.h"
4 #include "hex.h"
5 #include "object-store.h"
6 #include "repository.h"
gpg-interface.c
+1
@@ -1,6 +1,7 @@
1 #include "git-compat-util.h"
2 #include "commit.h"
3 #include "config.h"
4 +#include "date.h"
5 #include "gettext.h"
6 #include "run-command.h"
7 #include "strbuf.h"
grep.c
+1
@@ -4,6 +4,7 @@
4 #include "grep.h"
5 #include "hex.h"
6 #include "object-store.h"
7 +#include "pretty.h"
8 #include "userdiff.h"
9 #include "xdiff-interface.h"
10 #include "diff.h"
http-push.c
+1
@@ -15,6 +15,7 @@
15 #include "setup.h"
16 #include "sigchain.h"
17 #include "strvec.h"
18 +#include "tree.h"
19 #include "packfile.h"
20 #include "object-store.h"
21 #include "commit-reach.h"
log-tree.c
+1
@@ -24,6 +24,7 @@
24 #include "help.h"
25 #include "range-diff.h"
26 #include "strmap.h"
27 +#include "tree.h"
28 #include "write-or-die.h"
29
30 static struct decoration name_decoration = { "object names" };
merge-ort-wrappers.c
+1
@@ -3,6 +3,7 @@
3 #include "hash.h"
4 #include "merge-ort.h"
5 #include "merge-ort-wrappers.h"
6 +#include "tree.h"
7
8 #include "commit.h"
9
merge.c
+1
@@ -7,6 +7,7 @@
7 #include "commit.h"
8 #include "run-command.h"
9 #include "resolve-undo.h"
10 +#include "tree.h"
11 #include "tree-walk.h"
12 #include "unpack-trees.h"
13 #include "dir.h"
notes-cache.c
+1
@@ -1,6 +1,7 @@
1 #include "git-compat-util.h"
2 #include "notes-cache.h"
3 #include "object-store.h"
4 +#include "pretty.h"
5 #include "repository.h"
6 #include "commit.h"
7 #include "refs.h"
notes-utils.c
+1
@@ -6,6 +6,7 @@
6 #include "refs.h"
7 #include "notes-utils.h"
8 #include "repository.h"
9 +#include "strbuf.h"
10
11 void create_notes_commit(struct repository *r,
12 struct notes_tree *t,
object-name.c
+1
@@ -15,6 +15,7 @@
15 #include "dir.h"
16 #include "oid-array.h"
17 #include "packfile.h"
18 +#include "pretty.h"
19 #include "object-store.h"
20 #include "repository.h"
21 #include "setup.h"
pack-bitmap-write.c
+1
@@ -18,6 +18,7 @@
18 #include "commit-reach.h"
19 #include "prio-queue.h"
20 #include "trace2.h"
21 +#include "tree.h"
22
23 struct bitmapped_commit {
24 struct commit *commit;
parse-options-cb.c
+1
@@ -3,6 +3,7 @@
3 #include "branch.h"
4 #include "commit.h"
5 #include "color.h"
6 +#include "date.h"
7 #include "environment.h"
8 #include "gettext.h"
9 #include "object-name.h"
parse-options.c
+1
@@ -5,6 +5,7 @@
5 #include "commit.h"
6 #include "color.h"
7 #include "gettext.h"
8 +#include "strbuf.h"
9 #include "utf8.h"
10
11 static int disallow_abbreviated_options;
read-cache.c
+1
@@ -6,6 +6,7 @@
6 #include "cache.h"
7 #include "alloc.h"
8 #include "config.h"
9 +#include "date.h"
10 #include "diff.h"
11 #include "diffcore.h"
12 #include "hex.h"
ref-filter.c
+1
@@ -2,6 +2,7 @@
2 #include "alloc.h"
3 #include "environment.h"
4 #include "gettext.h"
5 +#include "gpg-interface.h"
6 #include "hex.h"
7 #include "parse-options.h"
8 #include "refs.h"
reflog.c
+1
@@ -4,6 +4,7 @@
4 #include "reflog.h"
5 #include "refs.h"
6 #include "revision.h"
7 +#include "tree.h"
8 #include "worktree.h"
9
10 /* Remember to update object flag allocation in object.h */
refs/debug.c
+1
@@ -1,6 +1,7 @@
1 #include "git-compat-util.h"
2 #include "hex.h"
3 #include "refs-internal.h"
4 +#include "string-list.h"
5 #include "trace.h"
6
7 static struct trace_key trace_refs = TRACE_KEY_INIT(REFS);
refspec.c
+1
@@ -6,6 +6,7 @@
6 #include "strvec.h"
7 #include "refs.h"
8 #include "refspec.h"
9 +#include "strbuf.h"
10
11 static struct refspec_item s_tag_refspec = {
12 .force = 0,
revision.h
+1
@@ -8,6 +8,7 @@
8 #include "pretty.h"
9 #include "diff.h"
10 #include "commit-slab-decl.h"
11 +#include "decorate.h"
12 #include "ident.h"
13 #include "list-objects-filter-options.h"
14
send-pack.c
+1
@@ -1,6 +1,7 @@
1 #include "git-compat-util.h"
2 #include "config.h"
3 #include "commit.h"
4 +#include "date.h"
5 #include "gettext.h"
6 #include "hex.h"
7 #include "refs.h"
wt-status.c
+1
@@ -22,6 +22,7 @@
22 #include "strbuf.h"
23 #include "trace.h"
24 #include "trace2.h"
25 +#include "tree.h"
26 #include "utf8.h"
27 #include "worktree.h"
28 #include "lockfile.h"