aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-04-06 13:38:31 -0700
committerJunio C Hamano <gitster@pobox.com>2023-04-06 13:38:31 -0700
commit6047b28eb7e1a0b0061c5310034f7b5683ea401a (patch)
treeaaf1292a72a358ebefa2e5e12756a84ecf1fba02 /builtin
parent72871b198f50962a555685726e42f435cdd4efa1 (diff)
parentec2f02696157d3781fbfd410f0017c49cc1eda01 (diff)
downloadgit-6047b28eb7e1a0b0061c5310034f7b5683ea401a.tar.xz
Merge branch 'en/header-split-cleanup'
Split key function and data structure definitions out of cache.h to new header files and adjust the users. * en/header-split-cleanup: csum-file.h: remove unnecessary inclusion of cache.h write-or-die.h: move declarations for write-or-die.c functions from cache.h treewide: remove cache.h inclusion due to setup.h changes setup.h: move declarations for setup.c functions from cache.h treewide: remove cache.h inclusion due to environment.h changes environment.h: move declarations for environment.c functions from cache.h treewide: remove unnecessary includes of cache.h wrapper.h: move declarations for wrapper.c functions from cache.h path.h: move function declarations for path.c functions from cache.h cache.h: remove expand_user_path() abspath.h: move absolute path functions from cache.h environment: move comment_line_char from cache.h treewide: remove unnecessary cache.h inclusion from several sources treewide: remove unnecessary inclusion of gettext.h treewide: be explicit about dependence on gettext.h treewide: remove unnecessary cache.h inclusion from a few headers
Diffstat (limited to 'builtin')
-rw-r--r--builtin/add.c1
-rw-r--r--builtin/am.c4
-rw-r--r--builtin/apply.c1
-rw-r--r--builtin/archive.c1
-rw-r--r--builtin/bisect.c3
-rw-r--r--builtin/blame.c4
-rw-r--r--builtin/branch.c3
-rw-r--r--builtin/bugreport.c5
-rw-r--r--builtin/bundle.c3
-rw-r--r--builtin/cat-file.c3
-rw-r--r--builtin/check-attr.c4
-rw-r--r--builtin/check-ignore.c2
-rw-r--r--builtin/check-mailmap.c2
-rw-r--r--builtin/check-ref-format.c1
-rw-r--r--builtin/checkout--worker.c1
-rw-r--r--builtin/checkout-index.c2
-rw-r--r--builtin/checkout.c3
-rw-r--r--builtin/clean.c3
-rw-r--r--builtin/clone.c4
-rw-r--r--builtin/column.c1
-rw-r--r--builtin/commit-graph.c2
-rw-r--r--builtin/commit-tree.c1
-rw-r--r--builtin/commit.c2
-rw-r--r--builtin/config.c5
-rw-r--r--builtin/count-objects.c2
-rw-r--r--builtin/credential-cache--daemon.c2
-rw-r--r--builtin/credential-cache.c3
-rw-r--r--builtin/credential-store.c2
-rw-r--r--builtin/describe.c3
-rw-r--r--builtin/diagnose.c2
-rw-r--r--builtin/diff-index.c1
-rw-r--r--builtin/diff-tree.c1
-rw-r--r--builtin/diff.c2
-rw-r--r--builtin/difftool.c5
-rw-r--r--builtin/fast-export.c1
-rw-r--r--builtin/fast-import.c4
-rw-r--r--builtin/fetch-pack.c1
-rw-r--r--builtin/fetch.c2
-rw-r--r--builtin/fmt-merge-msg.c2
-rw-r--r--builtin/for-each-ref.c1
-rw-r--r--builtin/for-each-repo.c1
-rw-r--r--builtin/fsck.c1
-rw-r--r--builtin/fsmonitor--daemon.c3
-rw-r--r--builtin/gc.c5
-rw-r--r--builtin/get-tar-commit-id.c1
-rw-r--r--builtin/grep.c3
-rw-r--r--builtin/hash-object.c4
-rw-r--r--builtin/help.c2
-rw-r--r--builtin/hook.c1
-rw-r--r--builtin/index-pack.c4
-rw-r--r--builtin/init-db.c5
-rw-r--r--builtin/interpret-trailers.c1
-rw-r--r--builtin/log.c4
-rw-r--r--builtin/ls-files.c2
-rw-r--r--builtin/ls-remote.c1
-rw-r--r--builtin/ls-tree.c1
-rw-r--r--builtin/mailinfo.c3
-rw-r--r--builtin/mailsplit.c1
-rw-r--r--builtin/merge-base.c1
-rw-r--r--builtin/merge-file.c3
-rw-r--r--builtin/merge-recursive.c1
-rw-r--r--builtin/merge-tree.c1
-rw-r--r--builtin/merge.c4
-rw-r--r--builtin/mktag.c1
-rw-r--r--builtin/mktree.c1
-rw-r--r--builtin/multi-pack-index.c3
-rw-r--r--builtin/mv.c4
-rw-r--r--builtin/name-rev.c2
-rw-r--r--builtin/notes.c2
-rw-r--r--builtin/pack-objects.c3
-rw-r--r--builtin/pack-redundant.c1
-rw-r--r--builtin/pack-refs.c1
-rw-r--r--builtin/patch-id.c1
-rw-r--r--builtin/prune-packed.c1
-rw-r--r--builtin/prune.c2
-rw-r--r--builtin/pull.c1
-rw-r--r--builtin/push.c2
-rw-r--r--builtin/range-diff.c1
-rw-r--r--builtin/read-tree.c2
-rw-r--r--builtin/rebase.c4
-rw-r--r--builtin/receive-pack.c4
-rw-r--r--builtin/reflog.c1
-rw-r--r--builtin/remote.c1
-rw-r--r--builtin/repack.c2
-rw-r--r--builtin/replace.c2
-rw-r--r--builtin/rerere.c2
-rw-r--r--builtin/reset.c3
-rw-r--r--builtin/rev-list.c2
-rw-r--r--builtin/rev-parse.c4
-rw-r--r--builtin/revert.c1
-rw-r--r--builtin/rm.c2
-rw-r--r--builtin/send-pack.c1
-rw-r--r--builtin/shortlog.c3
-rw-r--r--builtin/show-branch.c2
-rw-r--r--builtin/show-index.c1
-rw-r--r--builtin/show-ref.c1
-rw-r--r--builtin/sparse-checkout.c3
-rw-r--r--builtin/stash.c4
-rw-r--r--builtin/stripspace.c3
-rw-r--r--builtin/submodule--helper.c4
-rw-r--r--builtin/symbolic-ref.c1
-rw-r--r--builtin/tag.c3
-rw-r--r--builtin/unpack-file.c1
-rw-r--r--builtin/unpack-objects.c2
-rw-r--r--builtin/update-index.c4
-rw-r--r--builtin/update-ref.c1
-rw-r--r--builtin/update-server-info.c1
-rw-r--r--builtin/upload-pack.c1
-rw-r--r--builtin/verify-commit.c1
-rw-r--r--builtin/verify-pack.c1
-rw-r--r--builtin/verify-tag.c1
-rw-r--r--builtin/worktree.c4
-rw-r--r--builtin/write-tree.c2
113 files changed, 248 insertions, 1 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 61dd386d10..f12054d9be 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -9,6 +9,7 @@
#include "builtin.h"
#include "lockfile.h"
#include "dir.h"
+#include "gettext.h"
#include "pathspec.h"
#include "exec-cmd.h"
#include "cache-tree.h"
diff --git a/builtin/am.c b/builtin/am.c
index d89660d138..cd1e20f24e 100644
--- a/builtin/am.c
+++ b/builtin/am.c
@@ -5,9 +5,12 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "builtin.h"
+#include "environment.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "dir.h"
@@ -36,6 +39,7 @@
#include "packfile.h"
#include "repository.h"
#include "pretty.h"
+#include "wrapper.h"
/**
* Returns the length of the first line of msg.
diff --git a/builtin/apply.c b/builtin/apply.c
index 555219de40..fe72c0ec3e 100644
--- a/builtin/apply.c
+++ b/builtin/apply.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
#include "apply.h"
diff --git a/builtin/archive.c b/builtin/archive.c
index d0a583ea95..d13934f1a8 100644
--- a/builtin/archive.c
+++ b/builtin/archive.c
@@ -5,6 +5,7 @@
#include "cache.h"
#include "builtin.h"
#include "archive.h"
+#include "gettext.h"
#include "transport.h"
#include "parse-options.h"
#include "pkt-line.h"
diff --git a/builtin/bisect.c b/builtin/bisect.c
index c77564053a..26f07357a0 100644
--- a/builtin/bisect.c
+++ b/builtin/bisect.c
@@ -1,5 +1,7 @@
#include "builtin.h"
#include "cache.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "bisect.h"
@@ -10,6 +12,7 @@
#include "prompt.h"
#include "quote.h"
#include "revision.h"
+#include "wrapper.h"
static GIT_PATH_FUNC(git_path_bisect_terms, "BISECT_TERMS")
static GIT_PATH_FUNC(git_path_bisect_expected_rev, "BISECT_EXPECTED_REV")
diff --git a/builtin/blame.c b/builtin/blame.c
index 7f92f9c1d3..a8d2114adc 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -10,6 +10,8 @@
#include "config.h"
#include "color.h"
#include "builtin.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "commit.h"
@@ -29,7 +31,9 @@
#include "object-store.h"
#include "blame.h"
#include "refs.h"
+#include "setup.h"
#include "tag.h"
+#include "write-or-die.h"
static char blame_usage[] = N_("git blame [<options>] [<rev-opts>] [<rev>] [--] <file>");
static char annotate_usage[] = N_("git annotate [<options>] [<rev-opts>] [<rev>] [--] <file>");
diff --git a/builtin/branch.c b/builtin/branch.c
index 43f6839b33..6413a016c5 100644
--- a/builtin/branch.c
+++ b/builtin/branch.c
@@ -8,9 +8,11 @@
#include "cache.h"
#include "config.h"
#include "color.h"
+#include "environment.h"
#include "refs.h"
#include "commit.h"
#include "builtin.h"
+#include "gettext.h"
#include "remote.h"
#include "parse-options.h"
#include "branch.h"
@@ -24,6 +26,7 @@
#include "worktree.h"
#include "help.h"
#include "commit-reach.h"
+#include "wrapper.h"
static const char * const builtin_branch_usage[] = {
N_("git branch [<options>] [-r | -a] [--merged] [--no-merged]"),
diff --git a/builtin/bugreport.c b/builtin/bugreport.c
index 5bc254be80..52955e1d38 100644
--- a/builtin/bugreport.c
+++ b/builtin/bugreport.c
@@ -1,4 +1,6 @@
#include "builtin.h"
+#include "abspath.h"
+#include "gettext.h"
#include "parse-options.h"
#include "strbuf.h"
#include "help.h"
@@ -6,7 +8,8 @@
#include "hook.h"
#include "hook-list.h"
#include "diagnose.h"
-
+#include "setup.h"
+#include "wrapper.h"
static void get_system_info(struct strbuf *sys_info)
{
diff --git a/builtin/bundle.c b/builtin/bundle.c
index 666f01bccd..e68fc83d94 100644
--- a/builtin/bundle.c
+++ b/builtin/bundle.c
@@ -1,4 +1,7 @@
#include "builtin.h"
+#include "abspath.h"
+#include "gettext.h"
+#include "setup.h"
#include "strvec.h"
#include "parse-options.h"
#include "cache.h"
diff --git a/builtin/cat-file.c b/builtin/cat-file.c
index 44d202aa55..04d4bb6c77 100644
--- a/builtin/cat-file.c
+++ b/builtin/cat-file.c
@@ -9,6 +9,8 @@
#include "config.h"
#include "builtin.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "ident.h"
#include "parse-options.h"
@@ -21,6 +23,7 @@
#include "replace-object.h"
#include "promisor-remote.h"
#include "mailmap.h"
+#include "write-or-die.h"
enum batch_mode {
BATCH_MODE_CONTENTS,
diff --git a/builtin/check-attr.c b/builtin/check-attr.c
index d7a40e674c..1dbe9d6ca8 100644
--- a/builtin/check-attr.c
+++ b/builtin/check-attr.c
@@ -3,8 +3,12 @@
#include "cache.h"
#include "config.h"
#include "attr.h"
+#include "environment.h"
+#include "gettext.h"
#include "quote.h"
+#include "setup.h"
#include "parse-options.h"
+#include "write-or-die.h"
static int all_attrs;
static int cached_attrs;
diff --git a/builtin/check-ignore.c b/builtin/check-ignore.c
index ab776061c7..9401dad007 100644
--- a/builtin/check-ignore.c
+++ b/builtin/check-ignore.c
@@ -3,10 +3,12 @@
#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "gettext.h"
#include "quote.h"
#include "pathspec.h"
#include "parse-options.h"
#include "submodule.h"
+#include "write-or-die.h"
static int quiet, verbose, stdin_paths, show_non_matching, no_index;
static const char * const check_ignore_usage[] = {
diff --git a/builtin/check-mailmap.c b/builtin/check-mailmap.c
index 96db3ddb4b..002d2941e9 100644
--- a/builtin/check-mailmap.c
+++ b/builtin/check-mailmap.c
@@ -1,9 +1,11 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "ident.h"
#include "mailmap.h"
#include "parse-options.h"
#include "string-list.h"
+#include "write-or-die.h"
static int use_stdin;
static const char * const check_mailmap_usage[] = {
diff --git a/builtin/check-ref-format.c b/builtin/check-ref-format.c
index 462eefe102..57f0505070 100644
--- a/builtin/check-ref-format.c
+++ b/builtin/check-ref-format.c
@@ -5,6 +5,7 @@
#include "cache.h"
#include "refs.h"
#include "builtin.h"
+#include "setup.h"
#include "strbuf.h"
static const char builtin_check_ref_format_usage[] =
diff --git a/builtin/checkout--worker.c b/builtin/checkout--worker.c
index 0a7d762573..2120dd1d30 100644
--- a/builtin/checkout--worker.c
+++ b/builtin/checkout--worker.c
@@ -2,6 +2,7 @@
#include "alloc.h"
#include "config.h"
#include "entry.h"
+#include "gettext.h"
#include "parallel-checkout.h"
#include "parse-options.h"
#include "pkt-line.h"
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index cf6fba97ba..7df673e3e7 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -8,12 +8,14 @@
#include "builtin.h"
#include "config.h"
#include "dir.h"
+#include "gettext.h"
#include "lockfile.h"
#include "quote.h"
#include "cache-tree.h"
#include "parse-options.h"
#include "entry.h"
#include "parallel-checkout.h"
+#include "setup.h"
#define CHECKOUT_ALL 4
static int nul_term_line;
diff --git a/builtin/checkout.c b/builtin/checkout.c
index fcede4600a..38a8cd6a96 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -9,6 +9,8 @@
#include "config.h"
#include "diff.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "hook.h"
#include "ll-merge.h"
@@ -21,6 +23,7 @@
#include "resolve-undo.h"
#include "revision.h"
#include "run-command.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
#include "tree.h"
diff --git a/builtin/clean.c b/builtin/clean.c
index 10aaa8c603..14c0d555ea 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -8,10 +8,13 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "setup.h"
#include "string-list.h"
#include "quote.h"
#include "column.h"
diff --git a/builtin/clone.c b/builtin/clone.c
index e50e7e2c06..c171def1f3 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -10,7 +10,10 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
@@ -30,6 +33,7 @@
#include "branch.h"
#include "remote.h"
#include "run-command.h"
+#include "setup.h"
#include "connected.h"
#include "packfile.h"
#include "list-objects-filter-options.h"
diff --git a/builtin/column.c b/builtin/column.c
index 158fdf53d9..de623a16c2 100644
--- a/builtin/column.c
+++ b/builtin/column.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "strbuf.h"
#include "parse-options.h"
#include "string-list.h"
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c
index d3be7f3b31..9011426976 100644
--- a/builtin/commit-graph.c
+++ b/builtin/commit-graph.c
@@ -1,6 +1,8 @@
#include "builtin.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "parse-options.h"
diff --git a/builtin/commit-tree.c b/builtin/commit-tree.c
index b046c19306..15be167f87 100644
--- a/builtin/commit-tree.c
+++ b/builtin/commit-tree.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "hex.h"
#include "object-store.h"
#include "repository.h"
diff --git a/builtin/commit.c b/builtin/commit.c
index b8b4893ab2..9d8e1ea91a 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -12,10 +12,12 @@
#include "cache-tree.h"
#include "color.h"
#include "dir.h"
+#include "environment.h"
#include "builtin.h"
#include "diff.h"
#include "diffcore.h"
#include "commit.h"
+#include "gettext.h"
#include "revision.h"
#include "wt-status.h"
#include "run-command.h"
diff --git a/builtin/config.c b/builtin/config.c
index 49d832d409..fe79fb60c4 100644
--- a/builtin/config.c
+++ b/builtin/config.c
@@ -1,12 +1,17 @@
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "color.h"
+#include "environment.h"
+#include "gettext.h"
#include "ident.h"
#include "parse-options.h"
#include "urlmatch.h"
#include "quote.h"
+#include "setup.h"
#include "worktree.h"
+#include "wrapper.h"
static const char *const builtin_config_usage[] = {
N_("git config [<options>]"),
diff --git a/builtin/count-objects.c b/builtin/count-objects.c
index bb21bc43e4..f3d8f1bcbb 100644
--- a/builtin/count-objects.c
+++ b/builtin/count-objects.c
@@ -7,6 +7,8 @@
#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "repository.h"
#include "builtin.h"
#include "parse-options.h"
diff --git a/builtin/credential-cache--daemon.c b/builtin/credential-cache--daemon.c
index 6e509d02c3..62c09a271d 100644
--- a/builtin/credential-cache--daemon.c
+++ b/builtin/credential-cache--daemon.c
@@ -1,5 +1,7 @@
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
+#include "gettext.h"
#include "parse-options.h"
#ifndef NO_UNIX_SOCKETS
diff --git a/builtin/credential-cache.c b/builtin/credential-cache.c
index 78c02ad531..508da4c6e4 100644
--- a/builtin/credential-cache.c
+++ b/builtin/credential-cache.c
@@ -1,5 +1,8 @@
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "wrapper.h"
+#include "write-or-die.h"
#ifndef NO_UNIX_SOCKETS
diff --git a/builtin/credential-store.c b/builtin/credential-store.c
index 62a4f3c265..8977604eb9 100644
--- a/builtin/credential-store.c
+++ b/builtin/credential-store.c
@@ -1,9 +1,11 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "lockfile.h"
#include "credential.h"
#include "string-list.h"
#include "parse-options.h"
+#include "write-or-die.h"
static struct lock_file credential_lock;
diff --git a/builtin/describe.c b/builtin/describe.c
index 3e5595e0ed..0125d4ddba 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -1,6 +1,8 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "commit.h"
@@ -13,6 +15,7 @@
#include "revision.h"
#include "diff.h"
#include "hashmap.h"
+#include "setup.h"
#include "strvec.h"
#include "run-command.h"
#include "object-store.h"
diff --git a/builtin/diagnose.c b/builtin/diagnose.c
index d52015c67a..0f8b64994c 100644
--- a/builtin/diagnose.c
+++ b/builtin/diagnose.c
@@ -1,4 +1,6 @@
#include "builtin.h"
+#include "abspath.h"
+#include "gettext.h"
#include "parse-options.h"
#include "diagnose.h"
diff --git a/builtin/diff-index.c b/builtin/diff-index.c
index 35dc9b23ee..b9a19bb7d3 100644
--- a/builtin/diff-index.c
+++ b/builtin/diff-index.c
@@ -5,6 +5,7 @@
#include "commit.h"
#include "revision.h"
#include "builtin.h"
+#include "setup.h"
#include "submodule.h"
static const char diff_cache_usage[] =
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c
index a393efa4f0..385c2d0230 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 "gettext.h"
#include "hex.h"
#include "log-tree.h"
#include "builtin.h"
diff --git a/builtin/diff.c b/builtin/diff.c
index 99e7660881..5a6a5d7f4b 100644
--- a/builtin/diff.c
+++ b/builtin/diff.c
@@ -11,6 +11,7 @@
#include "color.h"
#include "commit.h"
#include "blob.h"
+#include "gettext.h"
#include "tag.h"
#include "diff.h"
#include "diff-merges.h"
@@ -18,6 +19,7 @@
#include "revision.h"
#include "log-tree.h"
#include "builtin.h"
+#include "setup.h"
#include "submodule.h"
#include "oid-array.h"
diff --git a/builtin/difftool.c b/builtin/difftool.c
index 74466332b5..e010a21bfb 100644
--- a/builtin/difftool.c
+++ b/builtin/difftool.c
@@ -13,10 +13,13 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "config.h"
#include "builtin.h"
#include "run-command.h"
+#include "environment.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "strvec.h"
@@ -25,6 +28,8 @@
#include "object-store.h"
#include "dir.h"
#include "entry.h"
+#include "setup.h"
+#include "wrapper.h"
static int trust_exit_code;
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 9844d4f3f4..8224bf4bc1 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 "gettext.h"
#include "hex.h"
#include "refs.h"
#include "refspec.h"
diff --git a/builtin/fast-import.c b/builtin/fast-import.c
index 6dbe1b165e..1fb95275d7 100644
--- a/builtin/fast-import.c
+++ b/builtin/fast-import.c
@@ -1,5 +1,8 @@
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
@@ -21,6 +24,7 @@
#include "commit-reach.h"
#include "khash.h"
#include "date.h"
+#include "wrapper.h"
#define PACK_ID_BITS 16
#define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 0d75e474f0..5f341b794d 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "alloc.h"
+#include "gettext.h"
#include "hex.h"
#include "pkt-line.h"
#include "fetch-pack.h"
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 46995f0f40..662a842479 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -3,6 +3,8 @@
*/
#include "cache.h"
#include "config.h"
+#include "gettext.h"
+#include "environment.h"
#include "hex.h"
#include "repository.h"
#include "refs.h"
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 8d8fd393f8..cc81241642 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -1,7 +1,9 @@
#include "builtin.h"
#include "config.h"
#include "fmt-merge-msg.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "wrapper.h"
static const char * const fmt_merge_msg_usage[] = {
N_("git fmt-merge-msg [-m <message>] [--log[=<n>] | --no-log] [--file <file>]"),
diff --git a/builtin/for-each-ref.c b/builtin/for-each-ref.c
index 6b3d07ef40..0bdc49a6e1 100644
--- a/builtin/for-each-ref.c
+++ b/builtin/for-each-ref.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "refs.h"
#include "object.h"
#include "parse-options.h"
diff --git a/builtin/for-each-repo.c b/builtin/for-each-repo.c
index ce8f7a9908..598ca16c46 100644
--- a/builtin/for-each-repo.c
+++ b/builtin/for-each-repo.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
#include "run-command.h"
#include "string-list.h"
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 4537d9f0f2..095b39d398 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
diff --git a/builtin/fsmonitor--daemon.c b/builtin/fsmonitor--daemon.c
index 3d4f2ae1d0..42af6a2cc7 100644
--- a/builtin/fsmonitor--daemon.c
+++ b/builtin/fsmonitor--daemon.c
@@ -1,6 +1,9 @@
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "parse-options.h"
#include "fsmonitor.h"
#include "fsmonitor-ipc.h"
diff --git a/builtin/gc.c b/builtin/gc.c
index 42a5b7092f..edd98d35a5 100644
--- a/builtin/gc.c
+++ b/builtin/gc.c
@@ -11,6 +11,8 @@
*/
#include "builtin.h"
+#include "abspath.h"
+#include "environment.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
@@ -32,7 +34,10 @@
#include "refs.h"
#include "remote.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "hook.h"
+#include "setup.h"
+#include "wrapper.h"
#define FAILED_RUN "failed to run %s"
diff --git a/builtin/get-tar-commit-id.c b/builtin/get-tar-commit-id.c
index 4324d39fb4..d5b871b21d 100644
--- a/builtin/get-tar-commit-id.c
+++ b/builtin/get-tar-commit-id.c
@@ -6,6 +6,7 @@
#include "tar.h"
#include "builtin.h"
#include "quote.h"
+#include "wrapper.h"
static const char builtin_get_tar_commit_id_usage[] =
"git get-tar-commit-id";
diff --git a/builtin/grep.c b/builtin/grep.c
index 49fc0c6909..a1b68d90bd 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "alloc.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
@@ -22,10 +23,12 @@
#include "quote.h"
#include "dir.h"
#include "pathspec.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
#include "object-store.h"
#include "packfile.h"
+#include "write-or-die.h"
static const char *grep_prefix;
diff --git a/builtin/hash-object.c b/builtin/hash-object.c
index 1848768b97..a15fe4fd3f 100644
--- a/builtin/hash-object.c
+++ b/builtin/hash-object.c
@@ -5,13 +5,17 @@
* Copyright (C) Junio C Hamano, 2005
*/
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
+#include "gettext.h"
#include "hex.h"
#include "object-store.h"
#include "blob.h"
#include "quote.h"
#include "parse-options.h"
#include "exec-cmd.h"
+#include "setup.h"
+#include "write-or-die.h"
/*
* This is to create corrupt objects for debugging and as such it
diff --git a/builtin/help.c b/builtin/help.c
index 53f2812dfb..87333a02ec 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -5,11 +5,13 @@
#include "config.h"
#include "builtin.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "parse-options.h"
#include "run-command.h"
#include "config-list.h"
#include "help.h"
#include "alias.h"
+#include "setup.h"
#ifndef DEFAULT_HELP_FORMAT
#define DEFAULT_HELP_FORMAT "man"
diff --git a/builtin/hook.c b/builtin/hook.c
index f95b7965c5..88051795c7 100644
--- a/builtin/hook.c
+++ b/builtin/hook.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "hook.h"
#include "parse-options.h"
#include "strbuf.h"
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index 6bd95f54d6..b17e79cd40 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -2,6 +2,8 @@
#include "alloc.h"
#include "config.h"
#include "delta.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "pack.h"
#include "csum-file.h"
@@ -18,6 +20,8 @@
#include "object-store.h"
#include "replace-object.h"
#include "promisor-remote.h"
+#include "setup.h"
+#include "wrapper.h"
static const char index_pack_usage[] =
"git index-pack [-v] [-o <index-file>] [--keep | --keep=<msg>] [--[no-]rev-index] [--verify] [--strict] (<pack-file> | --stdin [--fix-thin] [<pack-file>])";
diff --git a/builtin/init-db.c b/builtin/init-db.c
index dcaaf102ea..ba6e0b20fa 100644
--- a/builtin/init-db.c
+++ b/builtin/init-db.c
@@ -4,12 +4,17 @@
* Copyright (C) Linus Torvalds, 2005
*/
#include "cache.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "refs.h"
#include "builtin.h"
#include "exec-cmd.h"
#include "parse-options.h"
+#include "setup.h"
#include "worktree.h"
+#include "wrapper.h"
#ifndef DEFAULT_GIT_TEMPLATE_DIR
#define DEFAULT_GIT_TEMPLATE_DIR "/usr/share/git-core/templates"
diff --git a/builtin/interpret-trailers.c b/builtin/interpret-trailers.c
index e58627c72a..107ac28f0e 100644
--- a/builtin/interpret-trailers.c
+++ b/builtin/interpret-trailers.c
@@ -7,6 +7,7 @@
#include "cache.h"
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
#include "string-list.h"
#include "trailer.h"
diff --git a/builtin/log.c b/builtin/log.c
index a087222aea..7d19578963 100644
--- a/builtin/log.c
+++ b/builtin/log.c
@@ -5,8 +5,11 @@
* 2006 Junio Hamano
*/
#include "git-compat-util.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "refs.h"
#include "object-store.h"
@@ -37,6 +40,7 @@
#include "commit-reach.h"
#include "range-diff.h"
#include "tmp-objdir.h"
+#include "write-or-die.h"
#define MAIL_DEFAULT_WRAP 72
#define COVER_FROM_AUTO_MAX_SUBJECT_LEN 100
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 7fc82d7f76..ed35fa8d8e 100644
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
@@ -11,6 +11,7 @@
#include "quote.h"
#include "dir.h"
#include "builtin.h"
+#include "gettext.h"
#include "strbuf.h"
#include "tree.h"
#include "cache-tree.h"
@@ -19,6 +20,7 @@
#include "string-list.h"
#include "pathspec.h"
#include "run-command.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index a9de0575ce..3c74c4a104 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "gettext.h"
#include "hex.h"
#include "transport.h"
#include "ref-filter.h"
diff --git a/builtin/ls-tree.c b/builtin/ls-tree.c
index 568088b6d6..f32e6be219 100644
--- a/builtin/ls-tree.c
+++ b/builtin/ls-tree.c
@@ -5,6 +5,7 @@
*/
#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "hex.h"
#include "object-store.h"
#include "blob.h"
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 01d16ef9e5..a032a1c388 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -3,7 +3,10 @@
* email to figure out authorship and subject
*/
#include "cache.h"
+#include "abspath.h"
#include "builtin.h"
+#include "environment.h"
+#include "gettext.h"
#include "utf8.h"
#include "strbuf.h"
#include "mailinfo.h"
diff --git a/builtin/mailsplit.c b/builtin/mailsplit.c
index 91e93f0c77..0b6193a091 100644
--- a/builtin/mailsplit.c
+++ b/builtin/mailsplit.c
@@ -6,6 +6,7 @@
*/
#include "cache.h"
#include "builtin.h"
+#include "gettext.h"
#include "string-list.h"
#include "strbuf.h"
diff --git a/builtin/merge-base.c b/builtin/merge-base.c
index 671e424c26..3f22273b40 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 "gettext.h"
#include "hex.h"
#include "refs.h"
#include "diff.h"
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index c923bbf2ab..781818d08f 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -1,6 +1,9 @@
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
#include "config.h"
+#include "gettext.h"
+#include "setup.h"
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
#include "parse-options.h"
diff --git a/builtin/merge-recursive.c b/builtin/merge-recursive.c
index c1e3ca1216..91ed55f3ab 100644
--- a/builtin/merge-recursive.c
+++ b/builtin/merge-recursive.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "builtin.h"
#include "commit.h"
+#include "gettext.h"
#include "tag.h"
#include "merge-recursive.h"
#include "xdiff-interface.h"
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c
index 590532706e..803e380856 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 "gettext.h"
#include "hex.h"
#include "commit.h"
#include "commit-reach.h"
diff --git a/builtin/merge.c b/builtin/merge.c
index 6538a4bae9..a99be9610e 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -8,8 +8,11 @@
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "builtin.h"
@@ -46,6 +49,7 @@
#include "commit-reach.h"
#include "wt-status.h"
#include "commit-graph.h"
+#include "wrapper.h"
#define DEFAULT_TWOHEAD (1<<0)
#define DEFAULT_OCTOPUS (1<<1)
diff --git a/builtin/mktag.c b/builtin/mktag.c
index 9385320013..b3f6d7ea38 100644
--- a/builtin/mktag.c
+++ b/builtin/mktag.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "tag.h"
diff --git a/builtin/mktree.c b/builtin/mktree.c
index 848c7b4747..09a7bd5c5c 100644
--- a/builtin/mktree.c
+++ b/builtin/mktree.c
@@ -5,6 +5,7 @@
*/
#include "builtin.h"
#include "alloc.h"
+#include "gettext.h"
#include "hex.h"
#include "quote.h"
#include "tree.h"
diff --git a/builtin/multi-pack-index.c b/builtin/multi-pack-index.c
index 9a18a82b05..1b5083f8b2 100644
--- a/builtin/multi-pack-index.c
+++ b/builtin/multi-pack-index.c
@@ -1,6 +1,9 @@
#include "builtin.h"
+#include "abspath.h"
#include "cache.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "parse-options.h"
#include "midx.h"
#include "trace2.h"
diff --git a/builtin/mv.c b/builtin/mv.c
index 8129050377..b7c5ffbd8c 100644
--- a/builtin/mv.c
+++ b/builtin/mv.c
@@ -5,14 +5,18 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "pathspec.h"
#include "lockfile.h"
#include "dir.h"
#include "cache-tree.h"
#include "string-list.h"
#include "parse-options.h"
+#include "setup.h"
#include "submodule.h"
#include "entry.h"
diff --git a/builtin/name-rev.c b/builtin/name-rev.c
index 9d0dd0ad01..831d360a78 100644
--- a/builtin/name-rev.c
+++ b/builtin/name-rev.c
@@ -1,5 +1,7 @@
#include "builtin.h"
#include "alloc.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
diff --git a/builtin/notes.c b/builtin/notes.c
index 859a56591a..4ff44f1e3d 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -10,6 +10,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "gettext.h"
#include "hex.h"
#include "notes.h"
#include "object-store.h"
@@ -24,6 +25,7 @@
#include "notes-merge.h"
#include "notes-utils.h"
#include "worktree.h"
+#include "write-or-die.h"
static const char * const git_notes_usage[] = {
N_("git notes [--ref <notes-ref>] [list [<object>]]"),
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index bfaef00556..77d88f85b0 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -1,5 +1,7 @@
#include "builtin.h"
#include "alloc.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "config.h"
@@ -40,6 +42,7 @@
#include "promisor-remote.h"
#include "pack-mtimes.h"
#include "parse-options.h"
+#include "wrapper.h"
/*
* Objects we are going to pack are collected in the `to_pack` structure.
diff --git a/builtin/pack-redundant.c b/builtin/pack-redundant.c
index d50c2d6693..43e9d12dfd 100644
--- a/builtin/pack-redundant.c
+++ b/builtin/pack-redundant.c
@@ -7,6 +7,7 @@
*/
#include "builtin.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "packfile.h"
diff --git a/builtin/pack-refs.c b/builtin/pack-refs.c
index 27c2ca06ac..9833815fb3 100644
--- a/builtin/pack-refs.c
+++ b/builtin/pack-refs.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "parse-options.h"
#include "refs.h"
#include "repository.h"
diff --git a/builtin/patch-id.c b/builtin/patch-id.c
index 338b15cd7b..9d5585d3a7 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 "gettext.h"
#include "hex.h"
#include "parse-options.h"
diff --git a/builtin/prune-packed.c b/builtin/prune-packed.c
index da3273a268..ca3578e158 100644
--- a/builtin/prune-packed.c
+++ b/builtin/prune-packed.c
@@ -1,4 +1,5 @@
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
#include "prune-packed.h"
diff --git a/builtin/prune.c b/builtin/prune.c
index 202f736774..5c0952f5c6 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -1,6 +1,8 @@
#include "cache.h"
#include "commit.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "revision.h"
#include "builtin.h"
diff --git a/builtin/pull.c b/builtin/pull.c
index bc0f29064b..5405d09f22 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -9,6 +9,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "exec-cmd.h"
diff --git a/builtin/push.c b/builtin/push.c
index 12a402aea3..fa550b8f80 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -4,6 +4,8 @@
#include "cache.h"
#include "branch.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "refs.h"
#include "refspec.h"
#include "run-command.h"
diff --git a/builtin/range-diff.c b/builtin/range-diff.c
index 556ee84b6d..b72af527f0 100644
--- a/builtin/range-diff.c
+++ b/builtin/range-diff.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
#include "range-diff.h"
#include "config.h"
diff --git a/builtin/read-tree.c b/builtin/read-tree.c
index fe19852634..600d4f748f 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 "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "object.h"
@@ -18,6 +19,7 @@
#include "builtin.h"
#include "parse-options.h"
#include "resolve-undo.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
diff --git a/builtin/rebase.c b/builtin/rebase.c
index a70d94d075..680fe3c145 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -6,6 +6,9 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "run-command.h"
#include "exec-cmd.h"
@@ -30,6 +33,7 @@
#include "rebase-interactive.h"
#include "reset.h"
#include "hook.h"
+#include "wrapper.h"
static char const * const builtin_rebase_usage[] = {
N_("git rebase [-i] [options] [--exec <cmd>] "
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 5123c56f9d..9109552533 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -1,6 +1,9 @@
#include "builtin.h"
+#include "abspath.h"
#include "repository.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "pack.h"
@@ -32,6 +35,7 @@
#include "worktree.h"
#include "shallow.h"
#include "parse-options.h"
+#include "wrapper.h"
static const char * const receive_pack_usage[] = {
N_("git receive-pack <git-dir>"),
diff --git a/builtin/reflog.c b/builtin/reflog.c
index 9b000bb6bc..a1fa0c855f 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "revision.h"
#include "reachable.h"
#include "worktree.h"
diff --git a/builtin/remote.c b/builtin/remote.c
index a6b100dce7..1e0b137d97 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "config.h"
+#include "gettext.h"
#include "parse-options.h"
#include "transport.h"
#include "remote.h"
diff --git a/builtin/repack.c b/builtin/repack.c
index ab4c55b50f..df4d8e0f0b 100644
--- a/builtin/repack.c
+++ b/builtin/repack.c
@@ -2,6 +2,8 @@
#include "alloc.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "run-command.h"
diff --git a/builtin/replace.c b/builtin/replace.c
index 44ec170967..d2adc8ab61 100644
--- a/builtin/replace.c
+++ b/builtin/replace.c
@@ -11,6 +11,8 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "refs.h"
#include "parse-options.h"
diff --git a/builtin/rerere.c b/builtin/rerere.c
index 94ffb8c21a..d4a03707b1 100644
--- a/builtin/rerere.c
+++ b/builtin/rerere.c
@@ -2,9 +2,11 @@
#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "gettext.h"
#include "parse-options.h"
#include "string-list.h"
#include "rerere.h"
+#include "wrapper.h"
#include "xdiff/xdiff.h"
#include "xdiff-interface.h"
#include "pathspec.h"
diff --git a/builtin/reset.c b/builtin/reset.c
index c2a390b3a0..0ed329236c 100644
--- a/builtin/reset.c
+++ b/builtin/reset.c
@@ -10,6 +10,8 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "tag.h"
@@ -24,6 +26,7 @@
#include "parse-options.h"
#include "unpack-trees.h"
#include "cache-tree.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
#include "dir.h"
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index e88affc276..a3dbbb6338 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -2,6 +2,8 @@
#include "config.h"
#include "commit.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "revision.h"
#include "list-objects.h"
diff --git a/builtin/rev-parse.c b/builtin/rev-parse.c
index 5662101a10..1af2089f9b 100644
--- a/builtin/rev-parse.c
+++ b/builtin/rev-parse.c
@@ -5,9 +5,12 @@
*/
#define USE_THE_INDEX_VARIABLE
#include "cache.h"
+#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "commit.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "refs.h"
#include "quote.h"
@@ -15,6 +18,7 @@
#include "parse-options.h"
#include "diff.h"
#include "revision.h"
+#include "setup.h"
#include "split-index.h"
#include "submodule.h"
#include "commit-reach.h"
diff --git a/builtin/revert.c b/builtin/revert.c
index 287721fd37..f72761bf88 100644
--- a/builtin/revert.c
+++ b/builtin/revert.c
@@ -4,6 +4,7 @@
#include "builtin.h"
#include "parse-options.h"
#include "diff.h"
+#include "gettext.h"
#include "revision.h"
#include "rerere.h"
#include "dir.h"
diff --git a/builtin/rm.c b/builtin/rm.c
index e093cb9996..6be9281742 100644
--- a/builtin/rm.c
+++ b/builtin/rm.c
@@ -11,9 +11,11 @@
#include "lockfile.h"
#include "dir.h"
#include "cache-tree.h"
+#include "gettext.h"
#include "tree-walk.h"
#include "parse-options.h"
#include "string-list.h"
+#include "setup.h"
#include "submodule.h"
#include "pathspec.h"
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index 640125fe95..4784143004 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -17,6 +17,7 @@
#include "gettext.h"
#include "protocol.h"
#include "parse-options.h"
+#include "write-or-die.h"
static const char * const send_pack_usage[] = {
N_("git send-pack [--mirror] [--dry-run] [--force]\n"
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index f287a6acd0..46f4e0832a 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -3,10 +3,13 @@
#include "config.h"
#include "commit.h"
#include "diff.h"
+#include "environment.h"
+#include "gettext.h"
#include "string-list.h"
#include "revision.h"
#include "utf8.h"
#include "mailmap.h"
+#include "setup.h"
#include "shortlog.h"
#include "parse-options.h"
#include "trailer.h"
diff --git a/builtin/show-branch.c b/builtin/show-branch.c
index 70bc461638..463a8d11c3 100644
--- a/builtin/show-branch.c
+++ b/builtin/show-branch.c
@@ -1,5 +1,7 @@
#include "cache.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "pretty.h"
#include "refs.h"
diff --git a/builtin/show-index.c b/builtin/show-index.c
index 98ec40ddf4..d4bbbbcd6c 100644
--- a/builtin/show-index.c
+++ b/builtin/show-index.c
@@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
+#include "gettext.h"
#include "hex.h"
#include "pack.h"
#include "parse-options.h"
diff --git a/builtin/show-ref.c b/builtin/show-ref.c
index 63a5bb1efa..138d30a005 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 "gettext.h"
#include "hex.h"
#include "refs.h"
#include "object-store.h"
diff --git a/builtin/sparse-checkout.c b/builtin/sparse-checkout.c
index d73d3d2d82..090bf33510 100644
--- a/builtin/sparse-checkout.c
+++ b/builtin/sparse-checkout.c
@@ -2,6 +2,8 @@
#include "cache.h"
#include "config.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "parse-options.h"
#include "pathspec.h"
#include "repository.h"
@@ -14,6 +16,7 @@
#include "unpack-trees.h"
#include "wt-status.h"
#include "quote.h"
+#include "setup.h"
#include "sparse-index.h"
#include "worktree.h"
diff --git a/builtin/stash.c b/builtin/stash.c
index 6a3122cdd2..735d27039e 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -1,6 +1,9 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "refs.h"
@@ -15,6 +18,7 @@
#include "entry.h"
#include "rerere.h"
#include "revision.h"
+#include "setup.h"
#include "log-tree.h"
#include "diffcore.h"
#include "exec-cmd.h"
diff --git a/builtin/stripspace.c b/builtin/stripspace.c
index 1e34cf2beb..9451eb69ff 100644
--- a/builtin/stripspace.c
+++ b/builtin/stripspace.c
@@ -1,8 +1,11 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "parse-options.h"
+#include "setup.h"
#include "strbuf.h"
+#include "write-or-die.h"
static void comment_lines(struct strbuf *buf)
{
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index b836c0f6b7..569068e6a2 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -1,6 +1,9 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
+#include "abspath.h"
#include "alloc.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "cache.h"
@@ -9,6 +12,7 @@
#include "quote.h"
#include "pathspec.h"
#include "dir.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
#include "string-list.h"
diff --git a/builtin/symbolic-ref.c b/builtin/symbolic-ref.c
index e00768a8b7..10198a74fa 100644
--- a/builtin/symbolic-ref.c
+++ b/builtin/symbolic-ref.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "config.h"
#include "cache.h"
+#include "gettext.h"
#include "refs.h"
#include "parse-options.h"
diff --git a/builtin/tag.c b/builtin/tag.c
index f8705df14d..782bb3aa2f 100644
--- a/builtin/tag.c
+++ b/builtin/tag.c
@@ -9,6 +9,8 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "refs.h"
#include "object-store.h"
@@ -22,6 +24,7 @@
#include "column.h"
#include "ref-filter.h"
#include "date.h"
+#include "write-or-die.h"
static const char * const git_tag_usage[] = {
N_("git tag [-a | -s | -u <key-id>] [-f] [-m <msg> | -F <file>] [-e]\n"
diff --git a/builtin/unpack-file.c b/builtin/unpack-file.c
index 40fd42158d..00179180c7 100644
--- a/builtin/unpack-file.c
+++ b/builtin/unpack-file.c
@@ -2,6 +2,7 @@
#include "config.h"
#include "hex.h"
#include "object-store.h"
+#include "wrapper.h"
static char *create_temp_file(struct object_id *oid)
{
diff --git a/builtin/unpack-objects.c b/builtin/unpack-objects.c
index 1d3493b1eb..585e81b106 100644
--- a/builtin/unpack-objects.c
+++ b/builtin/unpack-objects.c
@@ -2,6 +2,8 @@
#include "cache.h"
#include "bulk-checkin.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "object-store.h"
#include "object.h"
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 11dc135271..03cda5e60d 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -7,6 +7,8 @@
#include "cache.h"
#include "bulk-checkin.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "lockfile.h"
#include "quote.h"
@@ -18,8 +20,10 @@
#include "parse-options.h"
#include "pathspec.h"
#include "dir.h"
+#include "setup.h"
#include "split-index.h"
#include "fsmonitor.h"
+#include "write-or-die.h"
/*
* Default to not allowing changes to the list of files. The
diff --git a/builtin/update-ref.c b/builtin/update-ref.c
index 1ba0727ba7..3ffd75b3e7 100644
--- a/builtin/update-ref.c
+++ b/builtin/update-ref.c
@@ -1,5 +1,6 @@
#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "refs.h"
#include "builtin.h"
#include "parse-options.h"
diff --git a/builtin/update-server-info.c b/builtin/update-server-info.c
index d2239c9ef4..e7bff27ae4 100644
--- a/builtin/update-server-info.c
+++ b/builtin/update-server-info.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "gettext.h"
#include "parse-options.h"
static const char * const update_server_info_usage[] = {
diff --git a/builtin/upload-pack.c b/builtin/upload-pack.c
index 7a3c68720f..beb9dd0861 100644
--- a/builtin/upload-pack.c
+++ b/builtin/upload-pack.c
@@ -1,6 +1,7 @@
#include "cache.h"
#include "builtin.h"
#include "exec-cmd.h"
+#include "gettext.h"
#include "pkt-line.h"
#include "parse-options.h"
#include "protocol.h"
diff --git a/builtin/verify-commit.c b/builtin/verify-commit.c
index 2a0c927ee9..4d10aa98b1 100644
--- a/builtin/verify-commit.c
+++ b/builtin/verify-commit.c
@@ -8,6 +8,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "gettext.h"
#include "object-store.h"
#include "repository.h"
#include "commit.h"
diff --git a/builtin/verify-pack.c b/builtin/verify-pack.c
index 27d6f75fd8..190fd69540 100644
--- a/builtin/verify-pack.c
+++ b/builtin/verify-pack.c
@@ -1,6 +1,7 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "gettext.h"
#include "run-command.h"
#include "parse-options.h"
diff --git a/builtin/verify-tag.c b/builtin/verify-tag.c
index 2a9aac43b8..28d0da6845 100644
--- a/builtin/verify-tag.c
+++ b/builtin/verify-tag.c
@@ -8,6 +8,7 @@
#include "cache.h"
#include "config.h"
#include "builtin.h"
+#include "gettext.h"
#include "tag.h"
#include "run-command.h"
#include "parse-options.h"
diff --git a/builtin/worktree.c b/builtin/worktree.c
index 84e2888fa2..39e9e5c9ce 100644
--- a/builtin/worktree.c
+++ b/builtin/worktree.c
@@ -1,8 +1,11 @@
#include "cache.h"
+#include "abspath.h"
#include "checkout.h"
#include "config.h"
#include "builtin.h"
#include "dir.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "parse-options.h"
#include "strvec.h"
@@ -14,6 +17,7 @@
#include "submodule.h"
#include "utf8.h"
#include "worktree.h"
+#include "wrapper.h"
#include "quote.h"
#define BUILTIN_WORKTREE_ADD_USAGE \
diff --git a/builtin/write-tree.c b/builtin/write-tree.c
index 7ad0d05945..6085f64d10 100644
--- a/builtin/write-tree.c
+++ b/builtin/write-tree.c
@@ -7,6 +7,8 @@
#include "builtin.h"
#include "cache.h"
#include "config.h"
+#include "environment.h"
+#include "gettext.h"
#include "hex.h"
#include "tree.h"
#include "cache-tree.h"