Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-03-18 00:03:08 +0300
committerJunio C Hamano <gitster@pobox.com>2023-03-18 00:03:09 +0300
commit88cc8ed8bc7d4bc9521b426e95ae2a38d3aec13a (patch)
tree856c32df7cde0ad5322804cddddc5ab09d3128e6 /builtin
parentf17d232f14135c9cce6e043389a9b7c434443606 (diff)
parentf524970185963a180ecf3a750a31405c4d0de484 (diff)
Merge branch 'en/header-cleanup'
Code clean-up to clarify the rule that "git-compat-util.h" must be the first to be included. * en/header-cleanup: diff.h: remove unnecessary include of object.h Remove unnecessary includes of builtin.h treewide: replace cache.h with more direct headers, where possible replace-object.h: move read_replace_refs declaration from cache.h to here object-store.h: move struct object_info from cache.h dir.h: refactor to no longer need to include cache.h object.h: stop depending on cache.h; make cache.h depend on object.h ident.h: move ident-related declarations out of cache.h pretty.h: move has_non_ascii() declaration from commit.h cache.h: remove dependence on hex.h; make other files include it explicitly hex.h: move some hex-related declarations from cache.h hash.h: move some oid-related declarations from cache.h alloc.h: move ALLOC_GROW() functions from cache.h treewide: remove unnecessary cache.h includes in source files treewide: remove unnecessary cache.h includes treewide: remove unnecessary git-compat-util.h includes in headers treewide: ensure one of the appropriate headers is sourced first
Diffstat (limited to 'builtin')
-rw-r--r--builtin/am.c1
-rw-r--r--builtin/bisect.c1
-rw-r--r--builtin/blame.c4
-rw-r--r--builtin/cat-file.c4
-rw-r--r--builtin/check-mailmap.c1
-rw-r--r--builtin/checkout--worker.c1
-rw-r--r--builtin/checkout.c1
-rw-r--r--builtin/clone.c1
-rw-r--r--builtin/commit-graph.c2
-rw-r--r--builtin/commit-tree.c1
-rw-r--r--builtin/config.c3
-rw-r--r--builtin/credential-cache--daemon.c1
-rw-r--r--builtin/describe.c1
-rw-r--r--builtin/diff-tree.c1
-rw-r--r--builtin/difftool.c1
-rw-r--r--builtin/fast-export.c1
-rw-r--r--builtin/fast-import.c1
-rw-r--r--builtin/fetch-pack.c2
-rw-r--r--builtin/fetch.c1
-rw-r--r--builtin/fsck.c2
-rw-r--r--builtin/fsmonitor--daemon.c1
-rw-r--r--builtin/gc.c1
-rw-r--r--builtin/grep.c2
-rw-r--r--builtin/hash-object.c1
-rw-r--r--builtin/index-pack.c3
-rw-r--r--builtin/log.c4
-rw-r--r--builtin/ls-remote.c1
-rw-r--r--builtin/ls-tree.c1
-rw-r--r--builtin/merge-base.c1
-rw-r--r--builtin/merge-index.c1
-rw-r--r--builtin/merge-tree.c1
-rw-r--r--builtin/merge.c2
-rw-r--r--builtin/mktag.c1
-rw-r--r--builtin/mktree.c2
-rw-r--r--builtin/mv.c1
-rw-r--r--builtin/name-rev.c3
-rw-r--r--builtin/notes.c1
-rw-r--r--builtin/pack-objects.c4
-rw-r--r--builtin/pack-redundant.c1
-rw-r--r--builtin/patch-id.c1
-rw-r--r--builtin/prune.c2
-rw-r--r--builtin/pull.c1
-rw-r--r--builtin/read-tree.c1
-rw-r--r--builtin/rebase.c1
-rw-r--r--builtin/receive-pack.c1
-rw-r--r--builtin/repack.c3
-rw-r--r--builtin/replace.c2
-rw-r--r--builtin/reset.c1
-rw-r--r--builtin/rev-list.c1
-rw-r--r--builtin/rev-parse.c2
-rw-r--r--builtin/revert.c3
-rw-r--r--builtin/rm.c1
-rw-r--r--builtin/send-pack.c1
-rw-r--r--builtin/show-branch.c1
-rw-r--r--builtin/show-index.c1
-rw-r--r--builtin/show-ref.c1
-rw-r--r--builtin/stash.c1
-rw-r--r--builtin/submodule--helper.c2
-rw-r--r--builtin/tag.c1
-rw-r--r--builtin/unpack-file.c1
-rw-r--r--builtin/unpack-objects.c2
-rw-r--r--builtin/update-index.c1
-rw-r--r--builtin/upload-pack.c1
-rw-r--r--builtin/var.c1
-rw-r--r--builtin/worktree.c1
-rw-r--r--builtin/write-tree.c1
66 files changed, 92 insertions, 7 deletions
diff --git a/builtin/am.c b/builtin/am.c
index e0848ddadf..3b5ea50cc5 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -8,6 +8,7 @@
#include "config.h"
#include "builtin.h"
#include "exec-cmd.h"
+#include "hex.h"
#include "parse-options.h"
#include "dir.h"
#include "run-command.h"
diff --git a/builtin/bisect.c b/builtin/bisect.c
index 7301740267..e8ee4a4dc8 100644
--- a/builtin/bisect.c
+++ b/builtin/bisect.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "parse-options.h"
#include "bisect.h"
#include "refs.h"
diff --git a/builtin/blame.c b/builtin/blame.c
index 71f925e456..fdd9f0c0fc 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -5,10 +5,12 @@
* See COPYING for licensing conditions
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "alloc.h"
#include "config.h"
#include "color.h"
#include "builtin.h"
+#include "hex.h"
#include "repository.h"
#include "commit.h"
#include "diff.h"
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index cc17635e76..b7a73acb07 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -5,9 +5,12 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "builtin.h"
#include "diff.h"
+#include "hex.h"
+#include "ident.h"
#include "parse-options.h"
#include "userdiff.h"
#include "streaming.h"
@@ -15,6 +18,7 @@
#include "oid-array.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "promisor-remote.h"
#include "mailmap.h"
diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c
index 7dc47e4793..96db3ddb4b 100644
--- a/builtin/check-mailmap.c
+++ b/builtin/check-mailmap.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "ident.h"
#include "mailmap.h"
#include "parse-options.h"
#include "string-list.h"
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index ede7dc32a4..0a7d762573 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "entry.h"
#include "parallel-checkout.h"
diff --git a/builtin/checkout.c b/builtin/checkout.c
index a5155cf55c..21a4335abb 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -9,6 +9,7 @@
#include "config.h"
#include "diff.h"
#include "dir.h"
+#include "hex.h"
#include "hook.h"
#include "ll-merge.h"
#include "lockfile.h"
diff --git a/builtin/clone.c b/builtin/clone.c
index 65b5b7db6d..462c286274 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -11,6 +11,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
#include "fetch-pack.h"
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index 93704f95a9..d3be7f3b31 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -1,12 +1,14 @@
#include "builtin.h"
#include "config.h"
#include "dir.h"
+#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
#include "repository.h"
#include "commit-graph.h"
#include "object-store.h"
#include "progress.h"
+#include "replace-object.h"
#include "tag.h"
#define BUILTIN_COMMIT_GRAPH_VERIFY_USAGE \
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index cc8d584be2..fefeed5d4b 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "repository.h"
#include "commit.h"
diff --git a/builtin/config.c b/builtin/config.c
index 060cf9f3e0..49d832d409 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -1,7 +1,8 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "color.h"
+#include "ident.h"
#include "parse-options.h"
#include "urlmatch.h"
#include "quote.h"
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
index 338058be7f..6e509d02c3 100644
--- a/builtin/credential-cache--daemon.c
+++ b/builtin/credential-cache--daemon.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "alloc.h"
#include "parse-options.h"
#ifndef NO_UNIX_SOCKETS
diff --git a/builtin/describe.c b/builtin/describe.c
index eea1e330c0..5b5930f5c8 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -1,6 +1,7 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "commit.h"
#include "tag.h"
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index 25b853b85c..a393efa4f0 100644
--- a/builtin/diff-tree.c
+++ b/builtin/diff-tree.c
@@ -3,6 +3,7 @@
#include "config.h"
#include "diff.h"
#include "commit.h"
+#include "hex.h"
#include "log-tree.h"
#include "builtin.h"
#include "submodule.h"
diff --git a/builtin/difftool.c b/builtin/difftool.c
index dbbfb19f19..01681d0fb8 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -17,6 +17,7 @@
#include "builtin.h"
#include "run-command.h"
#include "exec-cmd.h"
+#include "hex.h"
#include "parse-options.h"
#include "strvec.h"
#include "strbuf.h"
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 39a890fc00..78493c6d2b 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -6,6 +6,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "refs.h"
#include "refspec.h"
#include "object-store.h"
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 7134683ab9..160e2eedb7 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "lockfile.h"
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index afe679368d..702c9a3397 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -1,4 +1,6 @@
#include "builtin.h"
+#include "alloc.h"
+#include "hex.h"
#include "pkt-line.h"
#include "fetch-pack.h"
#include "remote.h"
diff --git a/builtin/fetch.c b/builtin/fetch.c
index a09606b472..b678a45baa 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -3,6 +3,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "repository.h"
#include "refs.h"
#include "refspec.h"
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 64614b43b2..e468e55325 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "commit.h"
@@ -18,6 +19,7 @@
#include "decorate.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "resolve-undo.h"
#include "run-command.h"
#include "worktree.h"
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index 0feef8caf6..cae804a190 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "parse-options.h"
#include "fsmonitor.h"
diff --git a/builtin/gc.c b/builtin/gc.c
index 02455fdcd7..67c7fe8a6e 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -11,6 +11,7 @@
*/
#include "builtin.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "tempfile.h"
diff --git a/builtin/grep.c b/builtin/grep.c
index f7821c5fbb..c590fcb19d 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -4,6 +4,8 @@
* Copyright (c) 2006 Junio C Hamano
*/
#include "cache.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "blob.h"
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index 44db83f07f..1848768b97 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -6,6 +6,7 @@
*/
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "blob.h"
#include "quote.h"
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 6648f2daef..b451755f40 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1,6 +1,8 @@
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "delta.h"
+#include "hex.h"
#include "pack.h"
#include "csum-file.h"
#include "blob.h"
@@ -14,6 +16,7 @@
#include "thread-utils.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "promisor-remote.h"
static const char index_pack_usage[] =
diff --git a/builtin/log.c b/builtin/log.c
index a70fba198f..45bfa86fe2 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -4,8 +4,10 @@
* (C) Copyright 2006 Linus Torvalds
* 2006 Junio Hamano
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "alloc.h"
#include "config.h"
+#include "hex.h"
#include "refs.h"
#include "object-store.h"
#include "color.h"
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 6516177348..2dfbd8ed9b 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "transport.h"
#include "ref-filter.h"
#include "remote.h"
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 8cc8c995df..64d8e54318 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "blob.h"
#include "tree.h"
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index 6f3941f2a4..be8f3b221c 100644
--- a/builtin/merge-base.c
+++ b/builtin/merge-base.c
@@ -2,6 +2,7 @@
#include "cache.h"
#include "config.h"
#include "commit.h"
+#include "hex.h"
#include "refs.h"
#include "diff.h"
#include "revision.h"
diff --git a/builtin/merge-index.c b/builtin/merge-index.c
index 452f833ac4..c875f5d37e 100644
--- a/builtin/merge-index.c
+++ b/builtin/merge-index.c
@@ -1,5 +1,6 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "hex.h"
#include "run-command.h"
static const char *pgm;
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 828dc81c42..e782518164 100644
--- a/builtin/merge-tree.c
+++ b/builtin/merge-tree.c
@@ -3,6 +3,7 @@
#include "tree-walk.h"
#include "xdiff-interface.h"
#include "help.h"
+#include "hex.h"
#include "commit.h"
#include "commit-reach.h"
#include "merge-ort.h"
diff --git a/builtin/merge.c b/builtin/merge.c
index 0a3c10a096..7347b738e5 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -8,7 +8,9 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "alloc.h"
#include "config.h"
+#include "hex.h"
#include "parse-options.h"
#include "builtin.h"
#include "lockfile.h"
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 5d22909122..42c2457c70 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "hex.h"
#include "parse-options.h"
#include "tag.h"
#include "replace-object.h"
diff --git a/builtin/mktree.c b/builtin/mktree.c
index 06d81400f5..848c7b4747 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -4,6 +4,8 @@
* Copyright (c) Junio C Hamano, 2006, 2009
*/
#include "builtin.h"
+#include "alloc.h"
+#include "hex.h"
#include "quote.h"
#include "tree.h"
#include "parse-options.h"
diff --git a/builtin/mv.c b/builtin/mv.c
index edd7b931fd..8129050377 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "alloc.h"
#include "config.h"
#include "pathspec.h"
#include "lockfile.h"
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 97959bfaf9..723ba616a8 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -1,5 +1,6 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "commit.h"
diff --git a/builtin/notes.c b/builtin/notes.c
index 80d9dfd25c..bba4c2e39f 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -10,6 +10,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "notes.h"
#include "object-store.h"
#include "repository.h"
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 74a167a180..2e73284f10 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1,5 +1,6 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "attr.h"
@@ -31,6 +32,7 @@
#include "list.h"
#include "packfile.h"
#include "object-store.h"
+#include "replace-object.h"
#include "dir.h"
#include "midx.h"
#include "trace2.h"
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index ecd49ca268..82115c5808 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -7,6 +7,7 @@
*/
#include "builtin.h"
+#include "hex.h"
#include "repository.h"
#include "packfile.h"
#include "object-store.h"
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index f840fbf1c7..338b15cd7b 100644
--- a/builtin/patch-id.c
+++ b/builtin/patch-id.c
@@ -2,6 +2,7 @@
#include "builtin.h"
#include "config.h"
#include "diff.h"
+#include "hex.h"
#include "parse-options.h"
static void flush_current_id(int patchlen, struct object_id *id, struct object_id *result)
diff --git a/builtin/prune.c b/builtin/prune.c
index 2719220108..f2ed45ccf0 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -1,12 +1,14 @@
#include "cache.h"
#include "commit.h"
#include "diff.h"
+#include "hex.h"
#include "revision.h"
#include "builtin.h"
#include "reachable.h"
#include "parse-options.h"
#include "progress.h"
#include "prune-packed.h"
+#include "replace-object.h"
#include "object-store.h"
#include "shallow.h"
diff --git a/builtin/pull.c b/builtin/pull.c
index 1ab4de0005..963a47f0b8 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -9,6 +9,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "parse-options.h"
#include "exec-cmd.h"
#include "run-command.h"
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index 6034408d48..11759c415f 100644
--- a/builtin/read-tree.c
+++ b/builtin/read-tree.c
@@ -7,6 +7,7 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "object.h"
#include "tree.h"
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 6635f10d52..ef8ce2f72c 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -6,6 +6,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "hex.h"
#include "run-command.h"
#include "exec-cmd.h"
#include "strvec.h"
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index cd5c7a28ef..3d2b4c8b4f 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "repository.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "pack.h"
#include "refs.h"
diff --git a/builtin/repack.c b/builtin/repack.c
index f649379531..966430a465 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -1,7 +1,8 @@
#include "builtin.h"
-#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "dir.h"
+#include "hex.h"
#include "parse-options.h"
#include "run-command.h"
#include "sigchain.h"
diff --git a/builtin/replace.c b/builtin/replace.c
index a29e911d30..71d8e949e3 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -11,10 +11,12 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "refs.h"
#include "parse-options.h"
#include "run-command.h"
#include "object-store.h"
+#include "replace-object.h"
#include "repository.h"
#include "tag.h"
diff --git a/builtin/reset.c b/builtin/reset.c
index 0697fa89de..58f567afd3 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -10,6 +10,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "tag.h"
#include "object.h"
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index d42db0b0cc..e4c9b74762 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -2,6 +2,7 @@
#include "config.h"
#include "commit.h"
#include "diff.h"
+#include "hex.h"
#include "revision.h"
#include "list-objects.h"
#include "list-objects-filter.h"
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index e67999e5eb..e1fa9c6348 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -5,8 +5,10 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "alloc.h"
#include "config.h"
#include "commit.h"
+#include "hex.h"
#include "refs.h"
#include "quote.h"
#include "builtin.h"
diff --git a/builtin/revert.c b/builtin/revert.c
index 77d2035616..62986a7b1b 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -1,4 +1,5 @@
-#include "cache.h"
+#include "git-compat-util.h"
+#include "alloc.h"
#include "config.h"
#include "builtin.h"
#include "parse-options.h"
diff --git a/builtin/rm.c b/builtin/rm.c
index 8844f90655..dc198f7908 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -5,6 +5,7 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "alloc.h"
#include "advice.h"
#include "config.h"
#include "lockfile.h"
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 4c5d125fa0..127ced435d 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "config.h"
#include "commit.h"
+#include "hex.h"
#include "refs.h"
#include "pkt-line.h"
#include "sideband.h"
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 358ac3e519..8342b68aef 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "pretty.h"
#include "refs.h"
#include "builtin.h"
diff --git a/builtin/show-index.c b/builtin/show-index.c
index 0e0b9fb95b..98ec40ddf4 100644
--- a/builtin/show-index.c
+++ b/builtin/show-index.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "hex.h"
#include "pack.h"
#include "parse-options.h"
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 3af6a53ee9..1f28d7fe4b 100644
--- a/builtin/show-ref.c
+++ b/builtin/show-ref.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "refs.h"
#include "object-store.h"
#include "object.h"
diff --git a/builtin/stash.c b/builtin/stash.c
index 3a4f9fd566..6a12fed271 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1,6 +1,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "parse-options.h"
#include "refs.h"
#include "lockfile.h"
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 4c173d8b37..2bbabbb28e 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1,5 +1,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "alloc.h"
+#include "hex.h"
#include "repository.h"
#include "cache.h"
#include "config.h"
diff --git a/builtin/tag.c b/builtin/tag.c
index d428c45dc8..be094882d0 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -9,6 +9,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "hex.h"
#include "refs.h"
#include "object-store.h"
#include "tag.h"
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 88de32b7d7..e9b105a539 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
static char *create_temp_file(struct object_id *oid)
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 43789b8ef2..1908dcfcff 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -2,12 +2,14 @@
#include "cache.h"
#include "bulk-checkin.h"
#include "config.h"
+#include "hex.h"
#include "object-store.h"
#include "object.h"
#include "delta.h"
#include "pack.h"
#include "blob.h"
#include "commit.h"
+#include "replace-object.h"
#include "tag.h"
#include "tree.h"
#include "tree-walk.h"
diff --git a/builtin/update-index.c b/builtin/update-index.c
index bf38885d54..11dc135271 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -7,6 +7,7 @@
#include "cache.h"
#include "bulk-checkin.h"
#include "config.h"
+#include "hex.h"
#include "lockfile.h"
#include "quote.h"
#include "cache-tree.h"
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 25b69da2bf..7a3c68720f 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -4,6 +4,7 @@
#include "pkt-line.h"
#include "parse-options.h"
#include "protocol.h"
+#include "replace-object.h"
#include "upload-pack.h"
#include "serve.h"
diff --git a/builtin/var.c b/builtin/var.c
index a80c1df86f..d9943be9af 100644
--- a/builtin/var.c
+++ b/builtin/var.c
@@ -5,6 +5,7 @@
*/
#include "builtin.h"
#include "config.h"
+#include "ident.h"
#include "refs.h"
static const char var_usage[] = "git var (-l | <variable>)";
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 254283aa6f..80d05e246d 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -3,6 +3,7 @@
#include "config.h"
#include "builtin.h"
#include "dir.h"
+#include "hex.h"
#include "parse-options.h"
#include "strvec.h"
#include "branch.h"
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index 078010315f..7ad0d05945 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -7,6 +7,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "hex.h"
#include "tree.h"
#include "cache-tree.h"
#include "parse-options.h"