Skip to contentSkip to conversation

Header cleanups (final splitting of cache.h, and some splitting of other headers)

PATCH Superseded Elijah Newren via GitGitGadget 8 participants 115 messages May 7, 2023 – May 24, 2023 Page 3 of 3

Subsystems (2)
lore
Share & tools
lore
#100 lore raw

PATCH v3 16/28 read-cache*.h: move declarations for read-cache.c functions from cache.h

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

For the functions defined in read-cache.c, move their declarations from cache.h to a new header, read-cache-ll.h. Also move some related inline functions from cache.h to read-cache.h. The purpose of the read-cache-ll.h/read-cache.h split is that about 70% of the sites don't need the inline functions and the extra headers they include.

---
 add-interactive.c                    |   1 +
 add-patch.c                          |   1 +
 apply.c                              |   1 +
 attr.c                               |   1 +
 blame.c                              |   1 +
 builtin/add.c                        |   1 +
 builtin/checkout--worker.c           |   1 +
 builtin/checkout-index.c             |   1 +
 builtin/checkout.c                   |   1 +
 builtin/clean.c                      |   1 +
 builtin/commit.c                     |   1 +
 builtin/describe.c                   |   1 +
 builtin/diff-tree.c                  |   1 +
 builtin/diff.c                       |   1 +
 builtin/difftool.c                   |   1 +
 builtin/fsck.c                       |   1 +
 builtin/grep.c                       |   1 +
 builtin/ls-files.c                   |   1 +
 builtin/merge-index.c                |   1 +
 builtin/mv.c                         |   1 +
 builtin/pull.c                       |   1 +
 builtin/rev-parse.c                  |   1 +
 builtin/rm.c                         |   1 +
 builtin/stash.c                      |   1 +
 builtin/submodule--helper.c          |   1 +
 builtin/update-index.c               |   1 +
 builtin/worktree.c                   |   1 +
 cache-tree.c                         |   1 +
 cache.h                              | 520 ---------------------------
 compat/precompose_utf8.c             |   1 +
 compat/sha1-chunked.c                |   1 +
 config.c                             |   1 +
 convert.c                            |   1 +
 diff-lib.c                           |   1 +
 diff.c                               |   1 +
 diffcore-break.c                     |   3 +-
 environment.h                        |   3 +-
 fsmonitor.h                          |   2 +
 git.c                                |   1 +
 hash-lookup.c                        |   1 +
 merge-ort-wrappers.c                 |   1 +
 merge-ort.c                          |   1 +
 name-hash.c                          |   2 +
 object-name.c                        |   1 +
 oidmap.h                             |   1 +
 parallel-checkout.c                  |   1 +
 pathspec.c                           |   1 +
 preload-index.c                      |   1 +
 read-cache-ll.h                      | 481 +++++++++++++++++++++++++
 read-cache.c                         |   1 +
 read-cache.h                         |  45 +++
 repository.c                         |   1 +
 rerere.c                             |   1 +
 resolve-undo.c                       |   1 +
 revision.c                           |   1 +
 split-index.c                        |   1 +
 submodule.c                          |   1 +
 t/helper/test-cache-tree.c           |   1 +
 t/helper/test-dump-cache-tree.c      |   1 +
 t/helper/test-dump-fsmonitor.c       |   1 +
 t/helper/test-dump-split-index.c     |   1 +
 t/helper/test-dump-untracked-cache.c |   1 +
 t/helper/test-fast-rebase.c          |   1 +
 t/helper/test-fsmonitor-client.c     |   1 +
 t/helper/test-hash-speed.c           |   1 +
 t/helper/test-index-version.c        |   1 +
 t/helper/test-lazy-init-name-hash.c  |   1 +
 t/helper/test-path-utils.c           |   1 +
 t/helper/test-read-cache.c           |   1 +
 t/helper/test-scrap-cache-tree.c     |   1 +
 t/helper/test-sha1.c                 |   1 +
 t/helper/test-sha256.c               |   1 +
 t/helper/test-strcmp-offset.c        |   1 +
 t/helper/test-write-cache.c          |   1 +
 unpack-trees.c                       |   1 +
 unpack-trees.h                       |   2 +-
 wt-status.c                          |   1 +
 77 files changed, 603 insertions(+), 524 deletions(-)
 create mode 100644 read-cache-ll.h
 create mode 100644 read-cache.h
add-interactive.c +1 -0
index 99f7dc3b0d1..a9671e33491 100644
@@ -6,6 +6,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "preload-index.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "refs.h"
 #include "string-list.h"
add-patch.c +1 -0
index 8d770d203ff..7d4d298286d 100644
@@ -6,6 +6,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "object-name.h"
+#include "read-cache-ll.h"
 #include "strbuf.h"
 #include "run-command.h"
 #include "strvec.h"
apply.c +1 -0
index 3da33bb88fd..f056c8f3bb9 100644
@@ -28,6 +28,7 @@
 #include "object-file.h"
 #include "parse-options.h"
 #include "quote.h"
+#include "read-cache.h"
 #include "rerere.h"
 #include "apply.h"
 #include "entry.h"
attr.c +1 -0
index ddf2b0cbc2e..57c813d8e77 100644
@@ -16,6 +16,7 @@
 #include "gettext.h"
 #include "utf8.h"
 #include "quote.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "object-store.h"
 #include "setup.h"
blame.c +1 -0
index 58dd58b6c97..a29ae7c14b2 100644
@@ -8,6 +8,7 @@
 #include "diffcore.h"
 #include "gettext.h"
 #include "hex.h"
+#include "read-cache.h"
 #include "setup.h"
 #include "tag.h"
 #include "trace2.h"
builtin/add.c +1 -0
index 8397be4f8de..9fe6b6ce290 100644
@@ -20,6 +20,7 @@
 #include "preload-index.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "read-cache.h"
 #include "revision.h"
 #include "bulk-checkin.h"
 #include "strvec.h"
builtin/checkout--worker.c +1 -0
index 2120dd1d300..c655dc4b136 100644
@@ -6,6 +6,7 @@
 #include "parallel-checkout.h"
 #include "parse-options.h"
 #include "pkt-line.h"
+#include "read-cache-ll.h"
 
 static void packet_to_pc_item(const char *buffer, int len,
 			      struct parallel_checkout_item *pc_item)
builtin/checkout-index.c +1 -0
index b1cd8bef264..f62f13f2b53 100644
@@ -16,6 +16,7 @@
 #include "parse-options.h"
 #include "entry.h"
 #include "parallel-checkout.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "sparse-index.h"
 
builtin/checkout.c +1 -0
index 2d72a742d9d..09b84156492 100644
@@ -21,6 +21,7 @@
 #include "object-store.h"
 #include "parse-options.h"
 #include "preload-index.h"
+#include "read-cache.h"
 #include "refs.h"
 #include "remote.h"
 #include "resolve-undo.h"
builtin/clean.c +1 -0
index 78852d28cec..49c7af45b03 100644
@@ -14,6 +14,7 @@
 #include "dir.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "string-list.h"
builtin/commit.c +1 -0
index fa769045c88..5be05c9d9e1 100644
@@ -31,6 +31,7 @@
 #include "object-name.h"
 #include "parse-options.h"
 #include "preload-index.h"
+#include "read-cache.h"
 #include "string-list.h"
 #include "rerere.h"
 #include "unpack-trees.h"
builtin/describe.c +1 -0
index 55b4baaa223..f1be7c36948 100644
@@ -13,6 +13,7 @@
 #include "exec-cmd.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "diff.h"
 #include "hashmap.h"
builtin/diff-tree.c +1 -0
index 0b02c62b85e..5a1e5d6df7c 100644
@@ -8,6 +8,7 @@
 #include "log-tree.h"
 #include "builtin.h"
 #include "submodule.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "tree.h"
 
builtin/diff.c +1 -0
index 967550739a6..a9ce701ff97 100644
@@ -17,6 +17,7 @@
 #include "diff-merges.h"
 #include "diffcore.h"
 #include "preload-index.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "log-tree.h"
 #include "builtin.h"
builtin/difftool.c +1 -0
index 2c27a59e04a..88809976c53 100644
@@ -23,6 +23,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "sparse-index.h"
 #include "strvec.h"
 #include "strbuf.h"
builtin/fsck.c +1 -0
index 7134596d218..e8c5fbca58f 100644
@@ -22,6 +22,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "read-cache-ll.h"
 #include "replace-object.h"
 #include "resolve-undo.h"
 #include "run-command.h"
builtin/grep.c +1 -0
index b86c754defb..0d567575890 100644
@@ -31,6 +31,7 @@
 #include "object-store.h"
 #include "packfile.h"
 #include "pager.h"
+#include "read-cache-ll.h"
 #include "write-or-die.h"
 
 static const char *grep_prefix;
builtin/ls-files.c +1 -0
index 45b3b0ce5d8..d8c1c62bcb0 100644
@@ -21,6 +21,7 @@
 #include "resolve-undo.h"
 #include "string-list.h"
 #include "pathspec.h"
+#include "read-cache.h"
 #include "run-command.h"
 #include "setup.h"
 #include "sparse-index.h"
builtin/merge-index.c +1 -0
index d16e8aa414b..270d5f644ac 100644
@@ -1,6 +1,7 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "hex.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "run-command.h"
 #include "sparse-index.h"
builtin/mv.c +1 -0
index e058b574654..ae462bd7d41 100644
@@ -19,6 +19,7 @@
 #include "cache-tree.h"
 #include "string-list.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "submodule.h"
builtin/pull.c +1 -0
index f9ddc94ba9a..8aeb5abc7fb 100644
@@ -20,6 +20,7 @@
 #include "oid-array.h"
 #include "remote.h"
 #include "dir.h"
+#include "read-cache-ll.h"
 #include "rebase.h"
 #include "refs.h"
 #include "refspec.h"
builtin/rev-parse.c +1 -0
index 852e49e3403..ad93e5fad88 100644
@@ -18,6 +18,7 @@
 #include "object-name.h"
 #include "parse-options.h"
 #include "diff.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "setup.h"
 #include "split-index.h"
builtin/rm.c +1 -0
index 377a0f66ad8..463eeabceaa 100644
@@ -16,6 +16,7 @@
 #include "tree-walk.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "read-cache.h"
 #include "repository.h"
 #include "string-list.h"
 #include "setup.h"
builtin/stash.c +1 -0
index 06527ee8471..d3d5bb95e26 100644
@@ -18,6 +18,7 @@
 #include "dir.h"
 #include "entry.h"
 #include "preload-index.h"
+#include "read-cache.h"
 #include "rerere.h"
 #include "revision.h"
 #include "setup.h"
builtin/submodule--helper.c +1 -0
index 597e780a93a..86324b829a7 100644
@@ -13,6 +13,7 @@
 #include "pathspec.h"
 #include "preload-index.h"
 #include "dir.h"
+#include "read-cache.h"
 #include "setup.h"
 #include "sparse-index.h"
 #include "submodule.h"
builtin/update-index.c +1 -0
index 47dc9b626ef..484a307df50 100644
@@ -22,6 +22,7 @@
 #include "parse-options.h"
 #include "pathspec.h"
 #include "dir.h"
+#include "read-cache.h"
 #include "repository.h"
 #include "setup.h"
 #include "sparse-index.h"
builtin/worktree.c +1 -0
index f3180463be2..3c3d97ad5b0 100644
@@ -13,6 +13,7 @@
 #include "parse-options.h"
 #include "strvec.h"
 #include "branch.h"
+#include "read-cache-ll.h"
 #include "refs.h"
 #include "repository.h"
 #include "run-command.h"
cache-tree.c +1 -0
index ebfe649b330..153217b47ff 100644
@@ -9,6 +9,7 @@
 #include "bulk-checkin.h"
 #include "object-file.h"
 #include "object-store.h"
+#include "read-cache-ll.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
 #include "sparse-index.h"
cache.h +0 -520

525 lines not on this page · raw message

compat/precompose_utf8.c +1 -0
index a4d11376ba5..fb08475bc64 100644
@@ -10,6 +10,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "path.h"
+#include "strbuf.h"
 #include "utf8.h"
 #include "precompose_utf8.h"
 
compat/sha1-chunked.c +1 -0
index 6adfcfd5405..56729d92dcf 100644
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "hash-ll.h"
 
 int git_SHA1_Update_Chunked(platform_SHA_CTX *c, const void *data, size_t len)
 {
config.c +1 -0
index b79baf83e35..06e6cc6f1ec 100644
@@ -33,6 +33,7 @@
 #include "replace-object.h"
 #include "refs.h"
 #include "setup.h"
+#include "strvec.h"
 #include "trace2.h"
 #include "worktree.h"
 #include "ws.h"
convert.c +1 -0
index 7cf7bd0c883..236d5e3dc25 100644
@@ -9,6 +9,7 @@
 #include "attr.h"
 #include "run-command.h"
 #include "quote.h"
+#include "read-cache-ll.h"
 #include "sigchain.h"
 #include "pkt-line.h"
 #include "sub-process.h"
diff-lib.c +1 -0
index 60e979dc1bd..36cd66ea237 100644
@@ -9,6 +9,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-name.h"
+#include "read-cache.h"
 #include "revision.h"
 #include "cache-tree.h"
 #include "unpack-trees.h"
diff.c +1 -0
index 07f140b425f..61b4dc61e1e 100644
@@ -39,6 +39,7 @@
 #include "dir.h"
 #include "object-file.h"
 #include "object-name.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "strmap.h"
 #include "ws.h"
diffcore-break.c +2 -1
index 5462420bbbe..4909dc088e6 100644
@@ -1,9 +1,10 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "object.h"
 #include "promisor-remote.h"
 
 static int should_break(struct repository *r,
environment.h +1 -2
index a63f0c6a24f..6eca4712e1e 100644
@@ -1,9 +1,8 @@
 #ifndef ENVIRONMENT_H
 #define ENVIRONMENT_H
 
-#include "strvec.h"
-
 struct repository;
+struct strvec;
 
 /*
  * The character that begins a commented line in user-editable file
fsmonitor.h +2 -0
index c67e0ebc09b..8b7a521552a 100644
@@ -4,6 +4,8 @@
 #include "cache.h"
 #include "dir.h"
 #include "fsmonitor-settings.h"
+#include "object.h"
+#include "read-cache-ll.h"
 #include "trace.h"
 
 extern struct trace_key trace_fsmonitor;
git.c +1 -0
index 45899be8265..a1a538fc52e 100644
@@ -5,6 +5,7 @@
 #include "gettext.h"
 #include "help.h"
 #include "pager.h"
+#include "read-cache-ll.h"
 #include "run-command.h"
 #include "alias.h"
 #include "replace-object.h"
hash-lookup.c +1 -0
index bb54dfde9c7..8fec8939fd3 100644
@@ -1,6 +1,7 @@
 #include "cache.h"
 #include "hash.h"
 #include "hash-lookup.h"
+#include "read-cache-ll.h"
 
 static uint32_t take2(const struct object_id *oid, size_t ofs)
 {
merge-ort-wrappers.c +1 -0
index a5507533009..a0bedcb63bb 100644
@@ -3,6 +3,7 @@
 #include "hash.h"
 #include "merge-ort.h"
 #include "merge-ort-wrappers.h"
+#include "read-cache-ll.h"
 #include "tree.h"
 
 #include "commit.h"
merge-ort.c +1 -0
index 4bff685e456..5512f40d321 100644
@@ -37,6 +37,7 @@
 #include "object-store.h"
 #include "oid-array.h"
 #include "promisor-remote.h"
+#include "read-cache-ll.h"
 #include "revision.h"
 #include "sparse-index.h"
 #include "strmap.h"
name-hash.c +2 -0
index 52ce47ea394..f2f3564cb20 100644
@@ -9,6 +9,8 @@
 #include "environment.h"
 #include "gettext.h"
 #include "name-hash.h"
+#include "object.h"
+#include "read-cache-ll.h"
 #include "thread-utils.h"
 #include "trace.h"
 #include "trace2.h"
object-name.c +1 -0
index 6fc3fa595b8..1eefeef746e 100644
@@ -18,6 +18,7 @@
 #include "packfile.h"
 #include "pretty.h"
 #include "object-store.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "submodule.h"
oidmap.h +1 -0
index c1642927fa6..05c673eb7c1 100644
@@ -1,6 +1,7 @@
 #ifndef OIDMAP_H
 #define OIDMAP_H
 
+#include "hash-ll.h"
 #include "hashmap.h"
 
 /*
parallel-checkout.c +1 -0
index 69d569f3525..2b1439c0c5f 100644
@@ -8,6 +8,7 @@
 #include "parallel-checkout.h"
 #include "pkt-line.h"
 #include "progress.h"
+#include "read-cache-ll.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "streaming.h"
pathspec.c +1 -0
index 1e57b6c667d..47d172fe414 100644
@@ -6,6 +6,7 @@
 #include "gettext.h"
 #include "pathspec.h"
 #include "attr.h"
+#include "read-cache.h"
 #include "repository.h"
 #include "setup.h"
 #include "strvec.h"
preload-index.c +1 -0
index c26739debf8..d037a951efa 100644
@@ -10,6 +10,7 @@
 #include "config.h"
 #include "preload-index.h"
 #include "progress.h"
+#include "read-cache.h"
 #include "thread-utils.h"
 #include "repository.h"
 #include "symlinks.h"
read-cache-ll.h new file +481 -0

481 lines not on this page · raw message

read-cache.c +1 -0
index 3fad839fb6f..42f27b06642 100644
@@ -28,6 +28,7 @@
 #include "name-hash.h"
 #include "object-name.h"
 #include "preload-index.h"
+#include "read-cache.h"
 #include "resolve-undo.h"
 #include "revision.h"
 #include "run-command.h"
read-cache.h new file +45 -0

45 lines not on this page · raw message

repository.c +1 -0
index c53e480e326..ebad755c2cc 100644
@@ -10,6 +10,7 @@
 #include "config.h"
 #include "object.h"
 #include "lockfile.h"
+#include "read-cache-ll.h"
 #include "remote.h"
 #include "setup.h"
 #include "submodule-config.h"
rerere.c +1 -0
index e968d413d65..3bc9aedc286 100644
@@ -7,6 +7,7 @@
 #include "hex.h"
 #include "lockfile.h"
 #include "string-list.h"
+#include "read-cache-ll.h"
 #include "rerere.h"
 #include "xdiff-interface.h"
 #include "dir.h"
resolve-undo.c +1 -0
index 7ec09e89d4f..59598877841 100644
@@ -1,6 +1,7 @@
 #include "cache.h"
 #include "dir.h"
 #include "hash.h"
+#include "read-cache.h"
 #include "resolve-undo.h"
 #include "sparse-index.h"
 #include "string-list.h"
revision.c +1 -0
index 88b2f42daa6..8d37ec9f495 100644
@@ -31,6 +31,7 @@
 #include "bisect.h"
 #include "packfile.h"
 #include "worktree.h"
+#include "read-cache.h"
 #include "setup.h"
 #include "sparse-index.h"
 #include "strvec.h"
split-index.c +1 -0
index 40e54760b35..0a8d3903d6f 100644
@@ -3,6 +3,7 @@
 #include "gettext.h"
 #include "hash.h"
 #include "mem-pool.h"
+#include "read-cache-ll.h"
 #include "split-index.h"
 #include "strbuf.h"
 #include "ewah/ewok.h"
submodule.c +1 -0
index 2e78f513496..e09722d6be3 100644
@@ -28,6 +28,7 @@
 #include "object-name.h"
 #include "object-store.h"
 #include "commit-reach.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "shallow.h"
 #include "trace2.h"
t/helper/test-cache-tree.c +1 -0
index 9507b356e22..9d64422b3cc 100644
@@ -6,6 +6,7 @@
 #include "tree.h"
 #include "cache-tree.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-dump-cache-tree.c +1 -0
index f22f7bd84a9..78aa11bb194 100644
@@ -5,6 +5,7 @@
 #include "hex.h"
 #include "tree.h"
 #include "cache-tree.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-dump-fsmonitor.c +1 -0
index 9a098a25cba..e4357d65ec5 100644
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-dump-split-index.c +1 -0
index 63fde9157c4..59a24a842b4 100644
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "hex.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "split-index.h"
t/helper/test-dump-untracked-cache.c +1 -0
index df70be549fd..a1cbafd64f3 100644
@@ -3,6 +3,7 @@
 #include "cache.h"
 #include "dir.h"
 #include "hex.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
t/helper/test-fast-rebase.c +1 -0
index d1d63feaa9e..cbcf2419f9b 100644
@@ -21,6 +21,7 @@
 #include "lockfile.h"
 #include "merge-ort.h"
 #include "object-name.h"
+#include "read-cache-ll.h"
 #include "refs.h"
 #include "revision.h"
 #include "sequencer.h"
t/helper/test-fsmonitor-client.c +1 -0
index 9f18c685b7f..386f4cdaee5 100644
@@ -7,6 +7,7 @@
 #include "cache.h"
 #include "parse-options.h"
 #include "fsmonitor-ipc.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "thread-utils.h"
t/helper/test-hash-speed.c +1 -0
index f40d9ad0c2d..c1e82d5d028 100644
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "hash-ll.h"
 
 #define NUM_SECONDS 3
 
t/helper/test-index-version.c +1 -0
index a06c45c1f84..b3cbaf6d2a8 100644
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "read-cache-ll.h"
 
 int cmd__index_version(int argc UNUSED, const char **argv UNUSED)
 {
t/helper/test-lazy-init-name-hash.c +1 -0
index 6944b7e825f..8eb327b3b93 100644
@@ -4,6 +4,7 @@
 #include "environment.h"
 #include "name-hash.h"
 #include "parse-options.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "trace.h"
t/helper/test-path-utils.c +1 -0
index 2ef53d5f7a2..90e4d29a06f 100644
@@ -3,6 +3,7 @@
 #include "abspath.h"
 #include "environment.h"
 #include "path.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "string-list.h"
 #include "trace.h"
t/helper/test-read-cache.c +1 -0
index c1ae2763954..0d548814e08 100644
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "config.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "wrapper.h"
t/helper/test-scrap-cache-tree.c +1 -0
index 6e17f50d225..7b7e2384043 100644
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "lockfile.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 #include "tree.h"
t/helper/test-sha1.c +1 -0
index 71fe5c61455..dc6fb17f2a7 100644
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "hash-ll.h"
 
 int cmd__sha1(int ac, const char **av)
 {
t/helper/test-sha256.c +1 -0
index 0ac6a99d5f2..f50f64f1f22 100644
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "hash-ll.h"
 
 int cmd__sha256(int ac, const char **av)
 {
t/helper/test-strcmp-offset.c +1 -0
index 96b9a5b5291..d3f39207f14 100644
@@ -1,5 +1,6 @@
 #include "test-tool.h"
 #include "cache.h"
+#include "read-cache-ll.h"
 
 int cmd__strcmp_offset(int argc UNUSED, const char **argv)
 {
t/helper/test-write-cache.c +1 -0
index eace08072d7..d27125eeacf 100644
@@ -2,6 +2,7 @@
 #include "test-tool.h"
 #include "cache.h"
 #include "lockfile.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
 
unpack-trees.c +1 -0
index 078c53f7a13..fdcc46e474f 100644
@@ -15,6 +15,7 @@
 #include "progress.h"
 #include "refs.h"
 #include "attr.h"
+#include "read-cache.h"
 #include "split-index.h"
 #include "sparse-index.h"
 #include "submodule.h"
unpack-trees.h +1 -1
index 30622aeebff..9b827c307f6 100644
@@ -1,8 +1,8 @@
 #ifndef UNPACK_TREES_H
 #define UNPACK_TREES_H
 
-#include "cache.h"
 #include "convert.h"
+#include "read-cache-ll.h"
 #include "strvec.h"
 #include "string-list.h"
 #include "tree-walk.h"
wt-status.c +1 -0
index 068b76ef6d9..847b63c906e 100644
@@ -18,6 +18,7 @@
 #include "refs.h"
 #include "submodule.h"
 #include "column.h"
+#include "read-cache.h"
 #include "setup.h"
 #include "strbuf.h"
 #include "trace.h"
Signature · 1 line
gitgitgadget
#101 lore raw

PATCH v3 17/28 cache.h: remove this no-longer-used header

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

Since this header showed up in some places besides just #include statements, update/clean-up/remove those other places as well.

Note that compat/fsmonitor/fsm-path-utils-darwin.c previously got away with violating the rule that all files must start with an include of git-compat-util.h (or a short-list of alternate headers that happen to include it first). This change exposed the violation and caused it to stop building correctly; fix it by having it include git-compat-util.h first, as per policy.

---
 Documentation/CodingGuidelines           |  2 +-
 Documentation/MyFirstObjectWalk.txt      |  2 +-
 Documentation/user-manual.txt            | 18 ++++++++----------
 Makefile                                 |  2 +-
 add-interactive.c                        |  2 +-
 add-patch.c                              |  2 +-
 apply.c                                  |  2 +-
 attr.c                                   |  2 +-
 blame.c                                  |  2 +-
 builtin.h                                |  1 -
 builtin/add.c                            |  3 +--
 builtin/am.c                             |  3 +--
 builtin/apply.c                          |  1 -
 builtin/archive.c                        |  1 -
 builtin/bisect.c                         |  1 -
 builtin/branch.c                         |  3 +--
 builtin/bundle.c                         |  1 -
 builtin/cat-file.c                       |  3 +--
 builtin/check-attr.c                     |  1 -
 builtin/check-ignore.c                   |  1 -
 builtin/check-ref-format.c               |  3 +--
 builtin/clean.c                          |  1 -
 builtin/column.c                         |  1 -
 builtin/commit-tree.c                    |  3 +--
 builtin/commit.c                         |  3 +--
 builtin/count-objects.c                  |  3 +--
 builtin/describe.c                       |  3 +--
 builtin/diff-files.c                     |  3 +--
 builtin/diff-index.c                     |  3 +--
 builtin/diff-tree.c                      |  3 +--
 builtin/diff.c                           |  3 +--
 builtin/difftool.c                       |  3 +--
 builtin/fast-export.c                    |  1 -
 builtin/fast-import.c                    |  1 -
 builtin/fetch.c                          |  3 +--
 builtin/for-each-ref.c                   |  1 -
 builtin/for-each-repo.c                  |  3 +--
 builtin/fsck.c                           |  1 -
 builtin/get-tar-commit-id.c              |  3 +--
 builtin/grep.c                           |  3 +--
 builtin/help.c                           |  3 +--
 builtin/hook.c                           |  1 -
 builtin/init-db.c                        |  3 +--
 builtin/interpret-trailers.c             |  1 -
 builtin/ls-files.c                       |  3 +--
 builtin/ls-remote.c                      |  1 -
 builtin/ls-tree.c                        |  3 +--
 builtin/mailinfo.c                       |  3 +--
 builtin/mailsplit.c                      |  1 -
 builtin/merge-base.c                     |  1 -
 builtin/merge-file.c                     |  1 -
 builtin/merge-recursive.c                |  1 -
 builtin/merge.c                          |  3 +--
 builtin/multi-pack-index.c               |  1 -
 builtin/notes.c                          |  3 +--
 builtin/patch-id.c                       |  1 -
 builtin/prune.c                          |  3 +--
 builtin/pull.c                           |  3 +--
 builtin/push.c                           |  3 +--
 builtin/range-diff.c                     |  1 -
 builtin/read-tree.c                      |  3 +--
 builtin/replace.c                        |  3 +--
 builtin/rerere.c                         |  1 -
 builtin/rev-list.c                       |  3 +--
 builtin/rev-parse.c                      |  3 +--
 builtin/shortlog.c                       |  1 -
 builtin/show-branch.c                    |  3 +--
 builtin/show-index.c                     |  1 -
 builtin/show-ref.c                       |  1 -
 builtin/sparse-checkout.c                |  1 -
 builtin/stripspace.c                     |  1 -
 builtin/submodule--helper.c              |  1 -
 builtin/symbolic-ref.c                   |  1 -
 builtin/tag.c                            |  3 +--
 builtin/unpack-objects.c                 |  1 -
 builtin/update-index.c                   |  3 +--
 builtin/update-ref.c                     |  3 +--
 builtin/update-server-info.c             |  3 +--
 builtin/upload-archive.c                 |  1 -
 builtin/upload-pack.c                    |  1 -
 builtin/verify-commit.c                  |  3 +--
 builtin/verify-pack.c                    |  1 -
 builtin/verify-tag.c                     |  3 +--
 builtin/worktree.c                       |  3 +--
 builtin/write-tree.c                     |  1 -
 cache-tree.c                             |  2 +-
 cache.h                                  |  6 ------
 compat/fsmonitor/fsm-health-win32.c      |  2 +-
 compat/fsmonitor/fsm-listen-win32.c      |  2 +-
 compat/fsmonitor/fsm-path-utils-darwin.c |  1 +
 compat/fsmonitor/fsm-path-utils-win32.c  |  2 +-
 compat/fsmonitor/fsm-settings-win32.c    |  2 +-
 compat/mingw.c                           |  1 -
 compat/precompose_utf8.c                 |  2 +-
 compat/sha1-chunked.c                    |  2 +-
 compat/simple-ipc/ipc-win32.c            |  2 +-
 compat/win32/trace2_win32_process_info.c |  2 +-
 convert.c                                |  2 +-
 diff-lib.c                               |  2 +-
 diff.c                                   |  2 +-
 entry.c                                  |  2 +-
 environment.c                            |  2 +-
 fsmonitor-ipc.c                          |  2 +-
 fsmonitor.c                              |  2 +-
 fsmonitor.h                              |  1 -
 hash-lookup.c                            |  2 +-
 merge-ort-wrappers.c                     |  2 +-
 merge-ort.c                              |  2 +-
 merge-recursive.c                        |  2 +-
 merge.c                                  |  2 +-
 name-hash.c                              |  2 +-
 object-name.c                            |  2 +-
 object.c                                 |  2 +-
 parallel-checkout.c                      |  2 +-
 pathspec.c                               |  2 +-
 preload-index.c                          |  2 +-
 read-cache.c                             |  2 +-
 refs/files-backend.c                     |  2 +-
 refs/packed-backend.c                    |  2 +-
 repository.c                             |  2 +-
 rerere.c                                 |  2 +-
 resolve-undo.c                           |  2 +-
 revision.c                               |  2 +-
 run-command.h                            |  2 +-
 sequencer.c                              |  2 +-
 shallow.c                                |  2 +-
 sparse-index.c                           |  2 +-
 split-index.c                            |  2 +-
 strbuf.h                                 |  4 ----
 submodule.c                              |  2 +-
 t/helper/test-cache-tree.c               |  1 -
 t/helper/test-dump-cache-tree.c          |  1 -
 t/helper/test-dump-fsmonitor.c           |  1 -
 t/helper/test-dump-split-index.c         |  1 -
 t/helper/test-dump-untracked-cache.c     |  1 -
 t/helper/test-fast-rebase.c              |  1 -
 t/helper/test-fsmonitor-client.c         |  1 -
 t/helper/test-hash-speed.c               |  1 -
 t/helper/test-index-version.c            |  1 -
 t/helper/test-lazy-init-name-hash.c      |  1 -
 t/helper/test-path-utils.c               |  1 -
 t/helper/test-read-cache.c               |  1 -
 t/helper/test-scrap-cache-tree.c         |  1 -
 t/helper/test-sha1.c                     |  1 -
 t/helper/test-sha256.c                   |  1 -
 t/helper/test-strcmp-offset.c            |  1 -
 t/helper/test-write-cache.c              |  1 -
 unpack-trees.c                           |  2 +-
 wt-status.c                              |  2 +-
 149 files changed, 99 insertions(+), 205 deletions(-)
 delete mode 100644 cache.h
Documentation/CodingGuidelines +1 -1
index 003393ed161..2b472df29d5 100644
@@ -444,7 +444,7 @@ For C programs:
  - The first #include in C files, except in platform specific compat/
    implementations and sha1dc/, must be either "git-compat-util.h" or
    one of the approved headers that includes it first for you.  (The
-   approved headers currently include "cache.h", "builtin.h",
+   approved headers currently include "builtin.h",
    "t/helper/test-tool.h", "xdiff/xinclude.h", or
    "reftable/system.h").  You do not have to include more than one of
    these.
Documentation/MyFirstObjectWalk.txt +1 -1
index eee513e86f4..200e628e301 100644
@@ -124,7 +124,7 @@ parameters provided by the user over the CLI.
 
 `nr` represents the number of `rev_cmdline_entry` present in the array.
 
-`alloc` is used by the `ALLOC_GROW` macro. Check `cache.h` - this variable is
+`alloc` is used by the `ALLOC_GROW` macro. Check `alloc.h` - this variable is
 used to track the allocated size of the list.
 
 Per entry, we find:
Documentation/user-manual.txt +8 -10
index dc9c6a663a9..100630ba3d2 100644
@@ -4102,13 +4102,11 @@ Note that terminology has changed since that revision.  For example, the
 README in that revision uses the word "changeset" to describe what we
 now call a <<def_commit_object,commit>>.
 
-Also, we do not call it "cache" any more, but rather "index"; however, the
-file is still called `cache.h`.  Remark: Not much reason to change it now,
-especially since there is no good single name for it anyway, because it is
-basically _the_ header file which is included by _all_ of Git's C sources.
+Also, we do not call it "cache" any more, but rather "index"; however,
+the file is still called `read-cache.h`.
 
 If you grasp the ideas in that initial commit, you should check out a
-more recent version and skim `cache.h`, `object.h` and `commit.h`.
+more recent version and skim `read-cache-ll.h`, `object.h` and `commit.h`.
 
 In the early days, Git (in the tradition of UNIX) was a bunch of programs
 which were extremely simple, and which you used in scripts, piping the
@@ -4119,11 +4117,11 @@ many of these parts have become builtins, and some of the core has been
 and to avoid code duplication.
 
 By now, you know what the index is (and find the corresponding data
-structures in `cache.h`), and that there are just a couple of object types
-(blobs, trees, commits and tags) which inherit their common structure from
-`struct object`, which is their first member (and thus, you can cast e.g.
-`(struct object *)commit` to achieve the _same_ as `&commit->object`, i.e.
-get at the object name and flags).
+structures in `read-cache-ll.h`), and that there are just a couple of
+object types (blobs, trees, commits and tags) which inherit their
+common structure from `struct object`, which is their first member
+(and thus, you can cast e.g.  `(struct object *)commit` to achieve the
+_same_ as `&commit->object`, i.e.  get at the object name and flags).
 
 Now is a good point to take a break to let this information sink in.
 
Makefile +1 -1
index cbc7f212016..2d180abc5ca 100644
@@ -1952,7 +1952,7 @@ endif
 	BASIC_CFLAGS += \
 		-DSHA1DC_NO_STANDARD_INCLUDES \
 		-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
-		-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
+		-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" \
 		-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
 endif
 endif
add-interactive.c +1 -1
index a9671e33491..40f88c02051 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "add-interactive.h"
 #include "color.h"
 #include "config.h"
add-patch.c +1 -1
index 7d4d298286d..875b96e2274 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "add-interactive.h"
 #include "advice.h"
 #include "alloc.h"
apply.c +1 -1
index f056c8f3bb9..e44a5dd7c50 100644
@@ -7,7 +7,7 @@
  *
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "alloc.h"
 #include "base85.h"
attr.c +1 -1
index 57c813d8e77..5a32bfadb37 100644
@@ -6,7 +6,7 @@
  * an insanely large number of attributes.
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "config.h"
 #include "environment.h"
blame.c +1 -1
index a29ae7c14b2..15bbf16057a 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "refs.h"
 #include "object-store.h"
 #include "cache-tree.h"
builtin.h +0 -1
index cb0db676814..3e6c22eef69 100644
@@ -3,7 +3,6 @@
 
 #include "git-compat-util.h"
 #include "strbuf.h"
-#include "cache.h"
 #include "commit.h"
 
 /*
builtin/add.c +1 -2
index 9fe6b6ce290..50792c0d495 100644
@@ -4,10 +4,9 @@
  * Copyright (C) 2006 Linus Torvalds
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "advice.h"
 #include "config.h"
-#include "builtin.h"
 #include "lockfile.h"
 #include "editor.h"
 #include "dir.h"
builtin/am.c +1 -2
index 0d8f46f8d5a..2f0f2337915 100644
@@ -4,11 +4,10 @@
  * Based on git-am.sh by Junio C Hamano.
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
 #include "config.h"
-#include "builtin.h"
 #include "editor.h"
 #include "environment.h"
 #include "exec-cmd.h"
builtin/apply.c +0 -1
index e3ff02a09e3..c18b7ea5d3d 100644
@@ -1,4 +1,3 @@
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
 #include "parse-options.h"
builtin/archive.c +0 -1
index b0eaa3c14a3..90761fdfee0 100644
@@ -2,7 +2,6 @@
  * Copyright (c) 2006 Franck Bui-Huu
  * Copyright (c) 2006 Rene Scharfe
  */
-#include "cache.h"
 #include "builtin.h"
 #include "archive.h"
 #include "gettext.h"
builtin/bisect.c +0 -1
index 4812450c393..bce0ee6268a 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "copy.h"
 #include "environment.h"
 #include "gettext.h"
builtin/branch.c +1 -2
index 501c47657c9..5e9b0e4ea44 100644
@@ -5,14 +5,13 @@
  * Based on git-branch.sh by Junio C Hamano.
  */
 
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "color.h"
 #include "editor.h"
 #include "environment.h"
 #include "refs.h"
 #include "commit.h"
-#include "builtin.h"
 #include "gettext.h"
 #include "object-name.h"
 #include "remote.h"
builtin/bundle.c +0 -1
index 44113389d7a..3f63631c039 100644
@@ -6,7 +6,6 @@
 #include "parse-options.h"
 #include "pkt-line.h"
 #include "repository.h"
-#include "cache.h"
 #include "bundle.h"
 
 /*
builtin/cat-file.c +1 -2
index 0bafc14e6c0..9646e7209ca 100644
@@ -4,11 +4,10 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "alloc.h"
 #include "config.h"
 #include "convert.h"
-#include "builtin.h"
 #include "diff.h"
 #include "environment.h"
 #include "gettext.h"
builtin/check-attr.c +0 -1
index b2b678847f5..869c04420d3 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "attr.h"
 #include "environment.h"
builtin/check-ignore.c +0 -1
index e4b78782a32..906cd967536 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "gettext.h"
builtin/check-ref-format.c +1 -2
index 57f0505070f..5eb6bdc3f69 100644
@@ -2,9 +2,8 @@
  * GIT - The information manager from hell
  */
 
-#include "cache.h"
-#include "refs.h"
 #include "builtin.h"
+#include "refs.h"
 #include "setup.h"
 #include "strbuf.h"
 
builtin/clean.c +0 -1
index 49c7af45b03..66b4479356d 100644
@@ -9,7 +9,6 @@
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "gettext.h"
builtin/column.c +0 -1
index de623a16c2d..ce13ff0baa2 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "strbuf.h"
builtin/commit-tree.c +1 -2
index d1d251c3ded..d2121f30d45 100644
@@ -3,7 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
@@ -12,7 +12,6 @@
 #include "repository.h"
 #include "commit.h"
 #include "tree.h"
-#include "builtin.h"
 #include "utf8.h"
 #include "gpg-interface.h"
 #include "parse-options.h"
builtin/commit.c +1 -2
index 5be05c9d9e1..3b90cb748cd 100644
@@ -6,7 +6,7 @@
  */
 
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "advice.h"
 #include "config.h"
 #include "lockfile.h"
@@ -15,7 +15,6 @@
 #include "dir.h"
 #include "editor.h"
 #include "environment.h"
-#include "builtin.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "commit.h"
builtin/count-objects.c +1 -2
index f3d8f1bcbb0..b9e6b55a9a9 100644
@@ -4,13 +4,12 @@
  * Copyright (c) 2006 Junio C Hamano
  */
 
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "repository.h"
-#include "builtin.h"
 #include "parse-options.h"
 #include "quote.h"
 #include "packfile.h"
builtin/describe.c +1 -2
index f1be7c36948..508e8df00ef 100644
@@ -1,5 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -9,7 +9,6 @@
 #include "tag.h"
 #include "blob.h"
 #include "refs.h"
-#include "builtin.h"
 #include "exec-cmd.h"
 #include "object-name.h"
 #include "parse-options.h"
builtin/diff-files.c +1 -2
index 2e6b59a8bb3..b7036aa7c2b 100644
@@ -3,14 +3,13 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "diff.h"
 #include "diff-merges.h"
 #include "commit.h"
 #include "preload-index.h"
 #include "revision.h"
-#include "builtin.h"
 #include "submodule.h"
 
 static const char diff_files_usage[] =
builtin/diff-index.c +1 -2
index 9b98db2e77e..1ab8f8b6dc5 100644
@@ -1,11 +1,10 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "diff.h"
 #include "diff-merges.h"
 #include "commit.h"
 #include "preload-index.h"
 #include "revision.h"
-#include "builtin.h"
 #include "setup.h"
 #include "submodule.h"
 
builtin/diff-tree.c +1 -2
index 5a1e5d6df7c..3e281150473 100644
@@ -1,12 +1,11 @@
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "diff.h"
 #include "commit.h"
 #include "gettext.h"
 #include "hex.h"
 #include "log-tree.h"
-#include "builtin.h"
 #include "submodule.h"
 #include "read-cache-ll.h"
 #include "repository.h"
builtin/diff.c +1 -2
index a9ce701ff97..b19530c996c 100644
@@ -4,7 +4,7 @@
  * Copyright (c) 2006 Junio C Hamano
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "ewah/ewok.h"
 #include "lockfile.h"
@@ -20,7 +20,6 @@
 #include "read-cache-ll.h"
 #include "revision.h"
 #include "log-tree.h"
-#include "builtin.h"
 #include "setup.h"
 #include "submodule.h"
 #include "oid-array.h"
builtin/difftool.c +1 -2
index 88809976c53..4a22de3eddb 100644
@@ -12,11 +12,10 @@
  * Copyright (C) 2016 Johannes Schindelin
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "config.h"
 #include "copy.h"
-#include "builtin.h"
 #include "run-command.h"
 #include "environment.h"
 #include "exec-cmd.h"
builtin/fast-export.c +0 -1
index 9a95f6a1a82..5f3ffd6912f 100644
@@ -4,7 +4,6 @@
  * Copyright (C) 2007 Johannes E. Schindelin
  */
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
builtin/fast-import.c +0 -1
index bbd9b2b3e71..67a2260a5eb 100644
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
builtin/fetch.c +1 -2
index 4d7c2897528..cbc991086cd 100644
@@ -1,7 +1,7 @@
 /*
  * "git fetch"
  */
-#include "cache.h"
+#include "builtin.h"
 #include "advice.h"
 #include "config.h"
 #include "gettext.h"
@@ -15,7 +15,6 @@
 #include "oidset.h"
 #include "oid-array.h"
 #include "commit.h"
-#include "builtin.h"
 #include "string-list.h"
 #include "remote.h"
 #include "transport.h"
builtin/for-each-ref.c +0 -1
index 695fc8f4a5e..d0d6ab0fd34 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "refs.h"
builtin/for-each-repo.c +1 -2
index 37daf7bec14..28186b30f54 100644
@@ -1,6 +1,5 @@
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "path.h"
builtin/fsck.c +0 -1
index e8c5fbca58f..f05617ceb14 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "gettext.h"
 #include "hex.h"
 #include "repository.h"
builtin/get-tar-commit-id.c +1 -2
index 564cfcac4fb..9303e386cc7 100644
@@ -1,10 +1,9 @@
 /*
  * Copyright (c) 2005, 2006 Rene Scharfe
  */
-#include "cache.h"
+#include "builtin.h"
 #include "commit.h"
 #include "tar.h"
-#include "builtin.h"
 #include "quote.h"
 #include "wrapper.h"
 
builtin/grep.c +1 -2
index 0d567575890..7638d779000 100644
@@ -3,7 +3,7 @@
  *
  * Copyright (c) 2006 Junio C Hamano
  */
-#include "cache.h"
+#include "builtin.h"
 #include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
@@ -14,7 +14,6 @@
 #include "commit.h"
 #include "tag.h"
 #include "tree-walk.h"
-#include "builtin.h"
 #include "parse-options.h"
 #include "string-list.h"
 #include "run-command.h"
builtin/help.c +1 -2
index d3cf4af3f6e..e93533fb09e 100644
@@ -1,9 +1,8 @@
 /*
  * Builtin help command
  */
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "exec-cmd.h"
 #include "gettext.h"
 #include "pager.h"
builtin/hook.c +0 -1
index 88051795c7f..09b51a6487c 100644
@@ -1,4 +1,3 @@
-#include "cache.h"
 #include "builtin.h"
 #include "config.h"
 #include "gettext.h"
builtin/init-db.c +1 -2
index feb019a9dea..680ef7e1837 100644
@@ -3,12 +3,11 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
-#include "builtin.h"
 #include "object-file.h"
 #include "parse-options.h"
 #include "path.h"
builtin/interpret-trailers.c +0 -1
index 107ac28f0e8..c5e83452654 100644
@@ -5,7 +5,6 @@
  *
  */
 
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
 #include "parse-options.h"
builtin/ls-files.c +1 -2
index d8c1c62bcb0..a49c43864f7 100644
@@ -5,13 +5,12 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "repository.h"
 #include "config.h"
 #include "convert.h"
 #include "quote.h"
 #include "dir.h"
-#include "builtin.h"
 #include "gettext.h"
 #include "object-name.h"
 #include "strbuf.h"
builtin/ls-remote.c +0 -1
index cb6cb77e086..a0aadc9b8ff 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "gettext.h"
 #include "hex.h"
 #include "transport.h"
builtin/ls-tree.c +1 -2
index 077977a4610..f4331c640fc 100644
@@ -3,7 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
@@ -13,7 +13,6 @@
 #include "tree.h"
 #include "commit.h"
 #include "quote.h"
-#include "builtin.h"
 #include "parse-options.h"
 #include "pathspec.h"
 
builtin/mailinfo.c +1 -2
index a032a1c3881..53b55dd71c0 100644
@@ -2,9 +2,8 @@
  * Another stupid program, this one parsing the headers of an
  * email to figure out authorship and subject
  */
-#include "cache.h"
-#include "abspath.h"
 #include "builtin.h"
+#include "abspath.h"
 #include "environment.h"
 #include "gettext.h"
 #include "utf8.h"
builtin/mailsplit.c +0 -1
index 0b6193a0915..3af9ddb8ae5 100644
@@ -4,7 +4,6 @@
  * It just splits a mbox into a list of files: "0001" "0002" ..
  * so you can process them further from there.
  */
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
 #include "string-list.h"
builtin/merge-base.c +0 -1
index 854019a32dc..e68b7fe45d7 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "commit.h"
 #include "gettext.h"
builtin/merge-file.c +0 -1
index 781818d08f5..d7eb4c65401 100644
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "setup.h"
builtin/merge-recursive.c +0 -1
index b9e980384a4..3366699657c 100644
@@ -1,4 +1,3 @@
-#include "cache.h"
 #include "builtin.h"
 #include "advice.h"
 #include "commit.h"
builtin/merge.c +1 -2
index 6e8f7b9bb53..d7ac108ce94 100644
@@ -7,7 +7,7 @@
  */
 
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "advice.h"
 #include "alloc.h"
@@ -18,7 +18,6 @@
 #include "hex.h"
 #include "object-name.h"
 #include "parse-options.h"
-#include "builtin.h"
 #include "lockfile.h"
 #include "run-command.h"
 #include "hook.h"
builtin/multi-pack-index.c +0 -1
index 1b5083f8b26..5bb71bce08d 100644
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "abspath.h"
-#include "cache.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
builtin/notes.c +1 -2
index d5788352b6e..efdf2451486 100644
@@ -7,9 +7,8 @@
  * and builtin/tag.c by Kristian Høgsberg and Carlos Rica.
  */
 
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "editor.h"
 #include "gettext.h"
 #include "hex.h"
builtin/patch-id.c +0 -1
index 9d5585d3a72..27952f1a6fd 100644
@@ -1,4 +1,3 @@
-#include "cache.h"
 #include "builtin.h"
 #include "config.h"
 #include "diff.h"
builtin/prune.c +1 -2
index 5dc9b207200..b3658b5b512 100644
@@ -1,11 +1,10 @@
-#include "cache.h"
+#include "builtin.h"
 #include "commit.h"
 #include "diff.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
 #include "revision.h"
-#include "builtin.h"
 #include "reachable.h"
 #include "parse-options.h"
 #include "progress.h"
builtin/pull.c +1 -2
index 8aeb5abc7fb..d4261804d76 100644
@@ -6,10 +6,9 @@
  * Fetch one or more remote refs and merge it/them into the current HEAD.
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "advice.h"
 #include "config.h"
-#include "builtin.h"
 #include "gettext.h"
 #include "hex.h"
 #include "merge.h"
builtin/push.c +1 -2
index 4e5780dd50d..62d44736500 100644
@@ -1,7 +1,7 @@
 /*
  * "git push"
  */
-#include "cache.h"
+#include "builtin.h"
 #include "advice.h"
 #include "branch.h"
 #include "config.h"
@@ -10,7 +10,6 @@
 #include "refs.h"
 #include "refspec.h"
 #include "run-command.h"
-#include "builtin.h"
 #include "remote.h"
 #include "transport.h"
 #include "parse-options.h"
builtin/range-diff.c +0 -1
index 04339a92ea5..8610390d7c5 100644
@@ -1,4 +1,3 @@
-#include "cache.h"
 #include "builtin.h"
 #include "gettext.h"
 #include "object-name.h"
builtin/read-tree.c +1 -2
index bd1ce1d963f..63c92936faa 100644
@@ -5,7 +5,7 @@
  */
 
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
@@ -17,7 +17,6 @@
 #include "cache-tree.h"
 #include "unpack-trees.h"
 #include "dir.h"
-#include "builtin.h"
 #include "parse-options.h"
 #include "repository.h"
 #include "resolve-undo.h"
builtin/replace.c +1 -2
index 981f1894436..e0fbdc98ed3 100644
@@ -8,9 +8,8 @@
  * git-tag.sh and mktag.c by Linus Torvalds.
  */
 
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "editor.h"
 #include "environment.h"
 #include "gettext.h"
builtin/rerere.c +0 -1
index d4bd52797f4..0458db9cadf 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "gettext.h"
builtin/rev-list.c +1 -2
index 6dc8be492a2..8029f3de53c 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "commit.h"
 #include "diff.h"
@@ -15,7 +15,6 @@
 #include "object-store.h"
 #include "pack.h"
 #include "pack-bitmap.h"
-#include "builtin.h"
 #include "log-tree.h"
 #include "graph.h"
 #include "bisect.h"
builtin/rev-parse.c +1 -2
index ad93e5fad88..8d8c870421d 100644
@@ -4,7 +4,7 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "alloc.h"
 #include "config.h"
@@ -14,7 +14,6 @@
 #include "hex.h"
 #include "refs.h"
 #include "quote.h"
-#include "builtin.h"
 #include "object-name.h"
 #include "parse-options.h"
 #include "diff.h"
builtin/shortlog.c +0 -1
index 46f4e0832ac..99be9dc417d 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "commit.h"
 #include "diff.h"
builtin/show-branch.c +1 -2
index 7ef4a642c17..cd215f89af8 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
@@ -6,7 +6,6 @@
 #include "hex.h"
 #include "pretty.h"
 #include "refs.h"
-#include "builtin.h"
 #include "color.h"
 #include "strvec.h"
 #include "object-name.h"
builtin/show-index.c +0 -1
index d839e55335d..540dc3dad1c 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "gettext.h"
 #include "hash.h"
 #include "hex.h"
builtin/show-ref.c +0 -1
index a2243b42195..e07e9ca862f 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
builtin/sparse-checkout.c +0 -1
index 40d420f06cb..5c8ffb1f759 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
builtin/stripspace.c +0 -1
index 9451eb69ff4..397d7fe2dcd 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
builtin/submodule--helper.c +0 -1
index 86324b829a7..17567d91c88 100644
@@ -6,7 +6,6 @@
 #include "gettext.h"
 #include "hex.h"
 #include "repository.h"
-#include "cache.h"
 #include "config.h"
 #include "parse-options.h"
 #include "quote.h"
builtin/symbolic-ref.c +0 -1
index 10198a74fae..a61fa3c0f81 100644
@@ -1,6 +1,5 @@
 #include "builtin.h"
 #include "config.h"
-#include "cache.h"
 #include "gettext.h"
 #include "refs.h"
 #include "parse-options.h"
builtin/tag.c +1 -2
index 1850a6a6fdc..ce298d08945 100644
@@ -6,10 +6,9 @@
  * Based on git-tag.sh and mktag.c by Linus Torvalds.
  */
 
-#include "cache.h"
+#include "builtin.h"
 #include "advice.h"
 #include "config.h"
-#include "builtin.h"
 #include "editor.h"
 #include "environment.h"
 #include "gettext.h"
builtin/unpack-objects.c +0 -1
index 2c52c3a741f..85baf6a131a 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "bulk-checkin.h"
 #include "config.h"
 #include "environment.h"
builtin/update-index.c +1 -2
index 484a307df50..aee3cb8cbd3 100644
@@ -4,7 +4,7 @@
  * Copyright (C) Linus Torvalds, 2005
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "builtin.h"
 #include "bulk-checkin.h"
 #include "config.h"
 #include "environment.h"
@@ -15,7 +15,6 @@
 #include "quote.h"
 #include "cache-tree.h"
 #include "tree-walk.h"
-#include "builtin.h"
 #include "object-file.h"
 #include "refs.h"
 #include "resolve-undo.h"
builtin/update-ref.c +1 -2
index 0c59b1c9eff..242102273ee 100644
@@ -1,9 +1,8 @@
-#include "cache.h"
+#include "builtin.h"
 #include "config.h"
 #include "gettext.h"
 #include "hash.h"
 #include "refs.h"
-#include "builtin.h"
 #include "object-name.h"
 #include "parse-options.h"
 #include "quote.h"
builtin/update-server-info.c +1 -2
index 19dce3c0655..1dc3971edeb 100644
@@ -1,6 +1,5 @@
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
 #include "server-info.h"
builtin/upload-archive.c +0 -1
index 44ad400e183..d4c7f162ff0 100644
@@ -1,7 +1,6 @@
 /*
  * Copyright (c) 2006 Franck Bui-Huu
  */
-#include "cache.h"
 #include "builtin.h"
 #include "archive.h"
 #include "pkt-line.h"
builtin/upload-pack.c +0 -1
index beb9dd08610..ba5103a9331 100644
@@ -1,4 +1,3 @@
-#include "cache.h"
 #include "builtin.h"
 #include "exec-cmd.h"
 #include "gettext.h"
builtin/verify-commit.c +1 -2
index 5d99b82a64f..aa34fb896ac 100644
@@ -5,9 +5,8 @@
  *
  * Based on git-verify-tag
  */
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
 #include "object-name.h"
 #include "object-store.h"
builtin/verify-pack.c +0 -1
index 190fd695409..aba92cf8af7 100644
@@ -1,5 +1,4 @@
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "gettext.h"
 #include "run-command.h"
builtin/verify-tag.c +1 -2
index c6019a0ad8c..d8753270ebe 100644
@@ -5,9 +5,8 @@
  *
  * Based on git-verify-tag.sh
  */
-#include "cache.h"
-#include "config.h"
 #include "builtin.h"
+#include "config.h"
 #include "gettext.h"
 #include "tag.h"
 #include "run-command.h"
builtin/worktree.c +1 -2
index 3c3d97ad5b0..b9a84988637 100644
@@ -1,9 +1,8 @@
-#include "cache.h"
+#include "builtin.h"
 #include "abspath.h"
 #include "checkout.h"
 #include "config.h"
 #include "copy.h"
-#include "builtin.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
builtin/write-tree.c +0 -1
index f98d54c1df2..5917085f429 100644
@@ -5,7 +5,6 @@
  */
 #define USE_THE_INDEX_VARIABLE
 #include "builtin.h"
-#include "cache.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
cache-tree.c +1 -1
index 153217b47ff..077932c2db5 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "environment.h"
 #include "hex.h"
cache.h deleted +0 -6
deleted file mode 100644
index 9b4e8d16874..00000000000
@@ -1,6 +0,0 @@
-#ifndef CACHE_H
-#define CACHE_H
-
-#include "git-compat-util.h"
-
-#endif /* CACHE_H */
compat/fsmonitor/fsm-health-win32.c +1 -1
index fe11bdd9ce6..6c81d7ee5c2 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "fsmonitor.h"
 #include "fsm-health.h"
compat/fsmonitor/fsm-listen-win32.c +1 -1
index 677b1bbdeca..3c0df5cff8c 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "fsmonitor.h"
 #include "fsm-listen.h"
compat/fsmonitor/fsm-path-utils-darwin.c +1 -0
index 45eb4a9b9e7..ef0142e0fbf 100644
@@ -1,3 +1,4 @@
+#include "git-compat-util.h"
 #include "fsmonitor.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
compat/fsmonitor/fsm-path-utils-win32.c +1 -1
index 4024baafb97..27bb6945183 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "fsmonitor.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
compat/fsmonitor/fsm-settings-win32.c +1 -1
index a8af31b71de..37288978643 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "repository.h"
 #include "fsmonitor.h"
compat/mingw.c +0 -1
index d06cdc6254f..559abb1c617 100644
@@ -6,7 +6,6 @@
 #include <wchar.h>
 #include "../strbuf.h"
 #include "../run-command.h"
-#include "../cache.h"
 #include "../abspath.h"
 #include "../alloc.h"
 #include "win32/lazyload.h"
compat/precompose_utf8.c +1 -1
index fb08475bc64..0bd5c24250a 100644
@@ -5,7 +5,7 @@
 
 #define PRECOMPOSE_UNICODE_C
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
compat/sha1-chunked.c +1 -1
index 56729d92dcf..a4a6f930d7b 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "hash-ll.h"
 
 int git_SHA1_Update_Chunked(platform_SHA_CTX *c, const void *data, size_t len)
compat/simple-ipc/ipc-win32.c +1 -1
index 6adce3c650e..8bfe51248e5 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "gettext.h"
 #include "simple-ipc.h"
compat/win32/trace2_win32_process_info.c +1 -1
index a4e33768f43..a2b1506f9c9 100644
@@ -1,4 +1,4 @@
-#include "../../cache.h"
+#include "../../git-compat-util.h"
 #include "../../json-writer.h"
 #include "../../repository.h"
 #include "../../trace2.h"
convert.c +1 -1
index 236d5e3dc25..9e89f660308 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "advice.h"
 #include "config.h"
 #include "convert.h"
diff-lib.c +1 -1
index 36cd66ea237..f3aa7f93c78 100644
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "quote.h"
 #include "commit.h"
 #include "diff.h"
diff.c +1 -1
index 61b4dc61e1e..5e81dc0d02d 100644
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2005 Junio C Hamano
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "alloc.h"
 #include "base85.h"
entry.c +1 -1
index 53d00386748..041f5cf212d 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "blob.h"
 #include "object-store.h"
 #include "dir.h"
environment.c +1 -1
index 28d18eaca8e..0cdd20a1589 100644
@@ -110,7 +110,7 @@ char *git_work_tree_cfg;
 static char *git_namespace;
 
 /*
- * Repository-local GIT_* environment variables; see cache.h for details.
+ * Repository-local GIT_* environment variables; see environment.h for details.
  */
 const char * const local_repo_env[] = {
 	ALTERNATE_DB_ENVIRONMENT,
fsmonitor-ipc.c +1 -1
index 6a6a89764a6..6ace978a1b4 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "fsmonitor.h"
 #include "gettext.h"
 #include "simple-ipc.h"
fsmonitor.c +1 -1
index 28c083d4d84..f670c509378 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
fsmonitor.h +0 -1
index 8b7a521552a..7702301d214 100644
@@ -1,7 +1,6 @@
 #ifndef FSMONITOR_H
 #define FSMONITOR_H
 
-#include "cache.h"
 #include "dir.h"
 #include "fsmonitor-settings.h"
 #include "object.h"
hash-lookup.c +1 -1
index 8fec8939fd3..9f0f95e2b9e 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "hash.h"
 #include "hash-lookup.h"
 #include "read-cache-ll.h"
merge-ort-wrappers.c +1 -1
index a0bedcb63bb..4acedf3c338 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "hash.h"
 #include "merge-ort.h"
merge-ort.c +1 -1
index 5512f40d321..c2d2ee73eaa 100644
@@ -14,7 +14,7 @@
  * "cale", "peedy", or "ins" instead of "ort"?)
  */
 
-#include "cache.h"
+#include "git-compat-util.h"
 #include "merge-ort.h"
 
 #include "alloc.h"
merge-recursive.c +1 -1
index 0e16e7a06df..4bef9b62fa8 100644
@@ -3,7 +3,7 @@
  * Fredrik Kuivinen.
  * The thieves were Alex Riesen and Johannes Schindelin, in June/July 2006
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "merge-recursive.h"
 
 #include "advice.h"
merge.c +1 -1
index fade6b203b3..83bcba6943e 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
 #include "gettext.h"
name-hash.c +1 -1
index f2f3564cb20..251f036eef6 100644
@@ -5,7 +5,7 @@
  *
  * Copyright (C) 2008 Linus Torvalds
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
 #include "name-hash.h"
object-name.c +1 -1
index 1eefeef746e..45f4d51305b 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "object-name.h"
 #include "advice.h"
 #include "config.h"
object.c +1 -1
index 333e736fb24..60f954194f7 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
 #include "object.h"
parallel-checkout.c +1 -1
index 2b1439c0c5f..602fbf19d3c 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "config.h"
 #include "entry.h"
pathspec.c +1 -1
index 47d172fe414..0baa85384f8 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "config.h"
 #include "dir.h"
preload-index.c +1 -1
index d037a951efa..e44530c80cf 100644
@@ -1,7 +1,7 @@
 /*
  * Copyright (C) 2008 Linus Torvalds
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "pathspec.h"
 #include "dir.h"
 #include "environment.h"
read-cache.c +1 -1
index 42f27b06642..edab96765df 100644
@@ -3,7 +3,7 @@
  *
  * Copyright (C) Linus Torvalds, 2005
  */
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "bulk-checkin.h"
 #include "config.h"
refs/files-backend.c +1 -1
index bca7b851c5a..01c08207619 100644
@@ -1,4 +1,4 @@
-#include "../cache.h"
+#include "../git-compat-util.h"
 #include "../config.h"
 #include "../copy.h"
 #include "../environment.h"
refs/packed-backend.c +1 -1
index 085becf773e..713491a9e2c 100644
@@ -1,4 +1,4 @@
-#include "../cache.h"
+#include "../git-compat-util.h"
 #include "../alloc.h"
 #include "../config.h"
 #include "../gettext.h"
repository.c +1 -1
index ebad755c2cc..67ec56a70c5 100644
@@ -3,7 +3,7 @@
  * declaration matches the definition in this file.
  */
 #define USE_THE_INDEX_VARIABLE
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "repository.h"
 #include "object-store.h"
rerere.c +1 -1
index 3bc9aedc286..2fb93a51125 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "alloc.h"
 #include "config.h"
resolve-undo.c +1 -1
index 59598877841..7817f5d6db1 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "dir.h"
 #include "hash.h"
 #include "read-cache.h"
revision.c +1 -1
index 8d37ec9f495..66a1fece0df 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "config.h"
 #include "environment.h"
run-command.h +1 -1
index 9e47f91d462..1f22cc3827d 100644
@@ -503,7 +503,7 @@ void run_processes_parallel(const struct run_process_parallel_opts *opts);
  * exception of GIT_CONFIG_PARAMETERS and GIT_CONFIG_COUNT (which cause the
  * corresponding environment variables to be unset in the subprocess) and adds
  * an environment variable pointing to new_git_dir. See local_repo_env in
- * cache.h for more information.
+ * environment.h for more information.
  */
 void prepare_other_repo_env(struct strvec *env, const char *new_git_dir);
 
sequencer.c +1 -1
index ec4a2e80a10..08bd0e81743 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "advice.h"
 #include "alloc.h"
shallow.c +1 -1
index a2ebf0af2ba..f1c93e74648 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "hex.h"
 #include "repository.h"
sparse-index.c +1 -1
index 60451daae80..2c47954d933 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
split-index.c +1 -1
index 0a8d3903d6f..0ee3865a553 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "alloc.h"
 #include "gettext.h"
 #include "hash.h"
strbuf.h +0 -4
index 3dfeadb44c2..e8dfab6ecd6 100644
@@ -72,10 +72,6 @@ struct strbuf {
 extern char strbuf_slopbuf[];
 #define STRBUF_INIT  { .buf = strbuf_slopbuf }
 
-/*
- * Predeclare this here, since cache.h includes this file before it defines the
- * struct.
- */
 struct object_id;
 
 /**
submodule.c +1 -1
index e09722d6be3..20aa8ed0fb8 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "abspath.h"
 #include "alloc.h"
 #include "repository.h"
t/helper/test-cache-tree.c +0 -1
index 9d64422b3cc..e7236392c81 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "gettext.h"
 #include "hex.h"
 #include "tree.h"
t/helper/test-dump-cache-tree.c +0 -1
index 78aa11bb194..c38f546e4f0 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "hash.h"
 #include "hex.h"
 #include "tree.h"
t/helper/test-dump-fsmonitor.c +0 -1
index e4357d65ec5..4f215fea025 100644
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
t/helper/test-dump-split-index.c +0 -1
index 59a24a842b4..5cf0b26dca1 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "hex.h"
 #include "read-cache-ll.h"
 #include "repository.h"
t/helper/test-dump-untracked-cache.c +0 -1
index a1cbafd64f3..b4af9712fe5 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "dir.h"
 #include "hex.h"
 #include "read-cache-ll.h"
t/helper/test-fast-rebase.c +0 -1
index cbcf2419f9b..62c5b5d704b 100644
@@ -12,7 +12,6 @@
 
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "cache-tree.h"
 #include "commit.h"
 #include "environment.h"
t/helper/test-fsmonitor-client.c +0 -1
index 386f4cdaee5..58d1dc5fc83 100644
@@ -4,7 +4,6 @@
  */
 
 #include "test-tool.h"
-#include "cache.h"
 #include "parse-options.h"
 #include "fsmonitor-ipc.h"
 #include "read-cache-ll.h"
t/helper/test-hash-speed.c +0 -1
index c1e82d5d028..b235da594f7 100644
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hash-ll.h"
 
 #define NUM_SECONDS 3
t/helper/test-index-version.c +0 -1
index b3cbaf6d2a8..f3c2dbe0a2c 100644
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "read-cache-ll.h"
 
 int cmd__index_version(int argc UNUSED, const char **argv UNUSED)
t/helper/test-lazy-init-name-hash.c +0 -1
index 8eb327b3b93..187a115d574 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "environment.h"
 #include "name-hash.h"
 #include "parse-options.h"
t/helper/test-path-utils.c +0 -1
index 90e4d29a06f..70396fa3845 100644
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "abspath.h"
 #include "environment.h"
 #include "path.h"
t/helper/test-read-cache.c +0 -1
index 0d548814e08..56c2d25f359 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "config.h"
 #include "read-cache-ll.h"
 #include "repository.h"
t/helper/test-scrap-cache-tree.c +0 -1
index 7b7e2384043..0a816a96e28 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "lockfile.h"
 #include "read-cache-ll.h"
 #include "repository.h"
t/helper/test-sha1.c +0 -1
index dc6fb17f2a7..dcb7f6c0032 100644
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hash-ll.h"
 
 int cmd__sha1(int ac, const char **av)
t/helper/test-sha256.c +0 -1
index f50f64f1f22..08cf1490014 100644
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "hash-ll.h"
 
 int cmd__sha256(int ac, const char **av)
t/helper/test-strcmp-offset.c +0 -1
index d3f39207f14..d8473cf2fcf 100644
@@ -1,5 +1,4 @@
 #include "test-tool.h"
-#include "cache.h"
 #include "read-cache-ll.h"
 
 int cmd__strcmp_offset(int argc UNUSED, const char **argv)
t/helper/test-write-cache.c +0 -1
index d27125eeacf..f084034d38e 100644
@@ -1,6 +1,5 @@
 #define USE_THE_INDEX_VARIABLE
 #include "test-tool.h"
-#include "cache.h"
 #include "lockfile.h"
 #include "read-cache-ll.h"
 #include "repository.h"
unpack-trees.c +1 -1
index fdcc46e474f..4b620df3031 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "advice.h"
 #include "strvec.h"
 #include "repository.h"
wt-status.c +1 -1
index 847b63c906e..6ee8567ac2d 100644
@@ -1,4 +1,4 @@
-#include "cache.h"
+#include "git-compat-util.h"
 #include "advice.h"
 #include "wt-status.h"
 #include "object.h"
Signature · 1 line
gitgitgadget
#102 lore raw

PATCH v3 18/28 log-tree: replace include of revision.h with simple forward declaration

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

---
 builtin/diff-tree.c | 1 +
 log-tree.c          | 1 +
 log-tree.h          | 2 +-
 3 files changed, 3 insertions(+), 1 deletion(-)
builtin/diff-tree.c +1 -0
index 3e281150473..4ad55ecc3fc 100644
@@ -9,6 +9,7 @@
 #include "submodule.h"
 #include "read-cache-ll.h"
 #include "repository.h"
+#include "revision.h"
 #include "tree.h"
 
 static struct rev_info log_tree_opt;
log-tree.c +1 -0
index f4b22a60cc5..07d0b47b168 100644
@@ -16,6 +16,7 @@
 #include "reflog-walk.h"
 #include "refs.h"
 #include "replace-object.h"
+#include "revision.h"
 #include "string-list.h"
 #include "color.h"
 #include "gpg-interface.h"
log-tree.h +1 -1
index e7e4641cf83..bdb64328154 100644
@@ -1,7 +1,7 @@
 #ifndef LOG_TREE_H
 #define LOG_TREE_H
 
-#include "revision.h"
+struct rev_info;
 
 struct log_info {
 	struct commit *commit, *parent;
Signature · 1 line
gitgitgadget
#103 lore raw

PATCH v3 19/28 repository: remove unnecessary include of path.h

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

This also made it clear that several .c files that depended upon path.h were missing a #include for it; add the missing includes while at it.

---
 apply.c                           | 1 +
 archive.c                         | 1 +
 attr.c                            | 1 +
 bisect.c                          | 1 +
 blame.c                           | 1 +
 branch.c                          | 1 +
 builtin/add.c                     | 1 +
 builtin/am.c                      | 1 +
 builtin/bisect.c                  | 1 +
 builtin/branch.c                  | 1 +
 builtin/checkout.c                | 1 +
 builtin/clean.c                   | 1 +
 builtin/clone.c                   | 1 +
 builtin/commit.c                  | 1 +
 builtin/count-objects.c           | 1 +
 builtin/fast-import.c             | 1 +
 builtin/fetch.c                   | 1 +
 builtin/fsck.c                    | 1 +
 builtin/gc.c                      | 1 +
 builtin/grep.c                    | 1 +
 builtin/ls-files.c                | 1 +
 builtin/ls-tree.c                 | 1 +
 builtin/merge.c                   | 1 +
 builtin/notes.c                   | 1 +
 builtin/prune.c                   | 1 +
 builtin/pull.c                    | 1 +
 builtin/rebase.c                  | 1 +
 builtin/receive-pack.c            | 1 +
 builtin/remote.c                  | 1 +
 builtin/repack.c                  | 1 +
 builtin/replace.c                 | 1 +
 builtin/reset.c                   | 1 +
 builtin/rev-parse.c               | 1 +
 builtin/submodule--helper.c       | 1 +
 builtin/tag.c                     | 1 +
 builtin/upload-archive.c          | 1 +
 builtin/upload-pack.c             | 1 +
 builtin/worktree.c                | 1 +
 commit-graph.c                    | 1 +
 compat/fsmonitor/fsm-ipc-darwin.c | 1 +
 config.c                          | 1 +
 connect.c                         | 1 +
 dir.c                             | 1 +
 environment.c                     | 1 +
 fetch-pack.c                      | 1 +
 fsck.c                            | 1 +
 http-backend.c                    | 1 +
 merge-ort.c                       | 1 +
 merge-recursive.c                 | 1 +
 notes-merge.c                     | 1 +
 object-file.c                     | 1 +
 pack-bitmap-write.c               | 1 +
 pack-write.c                      | 1 +
 read-cache.c                      | 1 +
 refs.c                            | 1 +
 refs/files-backend.c              | 1 +
 remote.c                          | 1 +
 repository.c                      | 1 +
 repository.h                      | 2 --
 rerere.c                          | 1 +
 sequencer.c                       | 1 +
 server-info.c                     | 1 +
 setup.c                           | 1 +
 shallow.c                         | 1 +
 strbuf.c                          | 1 +
 submodule-config.c                | 1 +
 submodule.c                       | 1 +
 t/helper/test-ref-store.c         | 1 +
 tmp-objdir.c                      | 1 +
 worktree.c                        | 1 +
 wt-status.c                       | 1 +
 71 files changed, 70 insertions(+), 2 deletions(-)
apply.c +1 -0
index e44a5dd7c50..be58dc08d22 100644
@@ -27,6 +27,7 @@
 #include "object-name.h"
 #include "object-file.h"
 #include "parse-options.h"
+#include "path.h"
 #include "quote.h"
 #include "read-cache.h"
 #include "rerere.h"
archive.c +1 -0
index 641baad627b..802a34d6b91 100644
@@ -6,6 +6,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "path.h"
 #include "pretty.h"
 #include "setup.h"
 #include "refs.h"
attr.c +1 -0
index 5a32bfadb37..435b51e11ff 100644
@@ -14,6 +14,7 @@
 #include "attr.h"
 #include "dir.h"
 #include "gettext.h"
+#include "path.h"
 #include "utf8.h"
 #include "quote.h"
 #include "read-cache-ll.h"
bisect.c +1 -0
index 8d5f8e58851..9f7cf0be073 100644
@@ -19,6 +19,7 @@
 #include "commit-reach.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "dir.h"
 
 static struct oid_array good_revs;
blame.c +1 -0
index 15bbf16057a..b74ee70decf 100644
@@ -8,6 +8,7 @@
 #include "diffcore.h"
 #include "gettext.h"
 #include "hex.h"
+#include "path.h"
 #include "read-cache.h"
 #include "setup.h"
 #include "tag.h"
branch.c +1 -0
index 9415ee3f340..1c02078e6aa 100644
@@ -6,6 +6,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-name.h"
+#include "path.h"
 #include "refs.h"
 #include "refspec.h"
 #include "remote.h"
builtin/add.c +1 -0
index 50792c0d495..43183114487 100644
@@ -16,6 +16,7 @@
 #include "cache-tree.h"
 #include "run-command.h"
 #include "parse-options.h"
+#include "path.h"
 #include "preload-index.h"
 #include "diff.h"
 #include "diffcore.h"
builtin/am.c +1 -0
index 2f0f2337915..a78daa69714 100644
@@ -41,6 +41,7 @@
 #include "string-list.h"
 #include "packfile.h"
 #include "pager.h"
+#include "path.h"
 #include "repository.h"
 #include "pretty.h"
 #include "wrapper.h"
builtin/bisect.c +1 -0
index bce0ee6268a..6478df34890 100644
@@ -11,6 +11,7 @@
 #include "strvec.h"
 #include "run-command.h"
 #include "oid-array.h"
+#include "path.h"
 #include "prompt.h"
 #include "quote.h"
 #include "revision.h"
builtin/branch.c +1 -0
index 5e9b0e4ea44..84f13b0cc71 100644
@@ -18,6 +18,7 @@
 #include "parse-options.h"
 #include "branch.h"
 #include "diff.h"
+#include "path.h"
 #include "revision.h"
 #include "string-list.h"
 #include "column.h"
builtin/checkout.c +1 -0
index 09b84156492..716dcd4cae1 100644
@@ -20,6 +20,7 @@
 #include "object-name.h"
 #include "object-store.h"
 #include "parse-options.h"
+#include "path.h"
 #include "preload-index.h"
 #include "read-cache.h"
 #include "refs.h"
builtin/clean.c +1 -0
index 66b4479356d..1bb6b7965c5 100644
@@ -13,6 +13,7 @@
 #include "dir.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "path.h"
 #include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
builtin/clone.c +1 -0
index cc34c194f5e..6c5cb33f6a9 100644
@@ -39,6 +39,7 @@
 #include "setup.h"
 #include "connected.h"
 #include "packfile.h"
+#include "path.h"
 #include "pkt-line.h"
 #include "list-objects-filter-options.h"
 #include "hook.h"
builtin/commit.c +1 -0
index 3b90cb748cd..b3ab5e93844 100644
@@ -29,6 +29,7 @@
 #include "utf8.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "preload-index.h"
 #include "read-cache.h"
 #include "string-list.h"
builtin/count-objects.c +1 -0
index b9e6b55a9a9..c9f82d0bce9 100644
@@ -9,6 +9,7 @@
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
+#include "path.h"
 #include "repository.h"
 #include "parse-options.h"
 #include "quote.h"
builtin/fast-import.c +1 -0
index 67a2260a5eb..5698b92ae7d 100644
@@ -12,6 +12,7 @@
 #include "commit.h"
 #include "delta.h"
 #include "pack.h"
+#include "path.h"
 #include "refs.h"
 #include "csum-file.h"
 #include "quote.h"
builtin/fetch.c +1 -0
index cbc991086cd..4dbacd8f188 100644
@@ -28,6 +28,7 @@
 #include "utf8.h"
 #include "packfile.h"
 #include "pager.h"
+#include "path.h"
 #include "pkt-line.h"
 #include "list-objects-filter-options.h"
 #include "commit-reach.h"
builtin/fsck.c +1 -0
index f05617ceb14..d707ca32a61 100644
@@ -21,6 +21,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "read-cache-ll.h"
 #include "replace-object.h"
 #include "resolve-undo.h"
builtin/gc.c +1 -0
index d6e56e380cf..9ecc2513e9f 100644
@@ -30,6 +30,7 @@
 #include "object-store.h"
 #include "pack.h"
 #include "pack-objects.h"
+#include "path.h"
 #include "blob.h"
 #include "tree.h"
 #include "promisor-remote.h"
builtin/grep.c +1 -0
index 7638d779000..6bc8abcd3e1 100644
@@ -30,6 +30,7 @@
 #include "object-store.h"
 #include "packfile.h"
 #include "pager.h"
+#include "path.h"
 #include "read-cache-ll.h"
 #include "write-or-die.h"
 
builtin/ls-files.c +1 -0
index a49c43864f7..ab90f821e44 100644
@@ -19,6 +19,7 @@
 #include "parse-options.h"
 #include "resolve-undo.h"
 #include "string-list.h"
+#include "path.h"
 #include "pathspec.h"
 #include "read-cache.h"
 #include "run-command.h"
builtin/ls-tree.c +1 -0
index f4331c640fc..c06858de4bf 100644
@@ -12,6 +12,7 @@
 #include "blob.h"
 #include "tree.h"
 #include "commit.h"
+#include "path.h"
 #include "quote.h"
 #include "parse-options.h"
 #include "pathspec.h"
builtin/merge.c +1 -0
index d7ac108ce94..420e81008ed 100644
@@ -27,6 +27,7 @@
 #include "refspec.h"
 #include "commit.h"
 #include "diffcore.h"
+#include "path.h"
 #include "revision.h"
 #include "unpack-trees.h"
 #include "cache-tree.h"
builtin/notes.c +1 -0
index efdf2451486..0a870d90836 100644
@@ -15,6 +15,7 @@
 #include "notes.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "repository.h"
 #include "blob.h"
 #include "pretty.h"
builtin/prune.c +1 -0
index b3658b5b512..a46c5aa2b5b 100644
@@ -7,6 +7,7 @@
 #include "revision.h"
 #include "reachable.h"
 #include "parse-options.h"
+#include "path.h"
 #include "progress.h"
 #include "prune-packed.h"
 #include "replace-object.h"
builtin/pull.c +1 -0
index d4261804d76..815f6135189 100644
@@ -19,6 +19,7 @@
 #include "oid-array.h"
 #include "remote.h"
 #include "dir.h"
+#include "path.h"
 #include "read-cache-ll.h"
 #include "rebase.h"
 #include "refs.h"
builtin/rebase.c +1 -0
index ace1d5e8d11..91849f920f7 100644
@@ -24,6 +24,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "commit.h"
 #include "diff.h"
 #include "wt-status.h"
builtin/receive-pack.c +1 -0
index 1a31a583674..d1718a3ac90 100644
@@ -31,6 +31,7 @@
 #include "packfile.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "protocol.h"
 #include "commit-reach.h"
 #include "server-info.h"
builtin/remote.c +1 -0
index 1e0b137d977..3794f13330d 100644
@@ -2,6 +2,7 @@
 #include "config.h"
 #include "gettext.h"
 #include "parse-options.h"
+#include "path.h"
 #include "transport.h"
 #include "remote.h"
 #include "string-list.h"
builtin/repack.c +1 -0
index 0541c3ce157..fe8d5810d48 100644
@@ -6,6 +6,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "path.h"
 #include "run-command.h"
 #include "server-info.h"
 #include "sigchain.h"
builtin/replace.c +1 -0
index e0fbdc98ed3..6b266a66d30 100644
@@ -16,6 +16,7 @@
 #include "hex.h"
 #include "refs.h"
 #include "parse-options.h"
+#include "path.h"
 #include "run-command.h"
 #include "object-file.h"
 #include "object-name.h"
builtin/reset.c +1 -0
index 3dc41ac3327..f947c449d14 100644
@@ -26,6 +26,7 @@
 #include "branch.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "unpack-trees.h"
 #include "cache-tree.h"
 #include "setup.h"
builtin/rev-parse.c +1 -0
index 8d8c870421d..6eb5965bee4 100644
@@ -16,6 +16,7 @@
 #include "quote.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "diff.h"
 #include "read-cache-ll.h"
 #include "revision.h"
builtin/submodule--helper.c +1 -0
index 17567d91c88..6acba4ebb30 100644
@@ -9,6 +9,7 @@
 #include "config.h"
 #include "parse-options.h"
 #include "quote.h"
+#include "path.h"
 #include "pathspec.h"
 #include "preload-index.h"
 #include "dir.h"
builtin/tag.c +1 -0
index ce298d08945..87963d2cc0e 100644
@@ -16,6 +16,7 @@
 #include "refs.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "tag.h"
 #include "run-command.h"
 #include "parse-options.h"
builtin/upload-archive.c +1 -0
index d4c7f162ff0..1b09e5e1aa3 100644
@@ -3,6 +3,7 @@
  */
 #include "builtin.h"
 #include "archive.h"
+#include "path.h"
 #include "pkt-line.h"
 #include "sideband.h"
 #include "repository.h"
builtin/upload-pack.c +1 -0
index ba5103a9331..b02d479248a 100644
@@ -3,6 +3,7 @@
 #include "gettext.h"
 #include "pkt-line.h"
 #include "parse-options.h"
+#include "path.h"
 #include "protocol.h"
 #include "replace-object.h"
 #include "upload-pack.h"
builtin/worktree.c +1 -0
index b9a84988637..6ba463f6965 100644
@@ -10,6 +10,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "parse-options.h"
+#include "path.h"
 #include "strvec.h"
 #include "branch.h"
 #include "read-cache-ll.h"
commit-graph.c +1 -0
index 843bdb458d0..25cbd66c33a 100644
@@ -14,6 +14,7 @@
 #include "object-file.h"
 #include "object-store.h"
 #include "oid-array.h"
+#include "path.h"
 #include "alloc.h"
 #include "hashmap.h"
 #include "replace-object.h"
compat/fsmonitor/fsm-ipc-darwin.c +1 -0
index 793073aaa72..964bc074db6 100644
@@ -2,6 +2,7 @@
 #include "config.h"
 #include "gettext.h"
 #include "hex.h"
+#include "path.h"
 #include "repository.h"
 #include "strbuf.h"
 #include "fsmonitor.h"
config.c +1 -0
index 06e6cc6f1ec..666ec73bab1 100644
@@ -27,6 +27,7 @@
 #include "object-name.h"
 #include "object-store.h"
 #include "pager.h"
+#include "path.h"
 #include "utf8.h"
 #include "dir.h"
 #include "color.h"
connect.c +1 -0
index 3a0186280c4..37674f71122 100644
@@ -12,6 +12,7 @@
 #include "url.h"
 #include "string-list.h"
 #include "oid-array.h"
+#include "path.h"
 #include "transport.h"
 #include "trace2.h"
 #include "strbuf.h"
dir.c +1 -0
index 1e84b1e1f28..3cf3d428c7b 100644
@@ -16,6 +16,7 @@
 #include "name-hash.h"
 #include "object-file.h"
 #include "object-store.h"
+#include "path.h"
 #include "attr.h"
 #include "refs.h"
 #include "wildmatch.h"
environment.c +1 -0
index 0cdd20a1589..56e8742ea66 100644
@@ -21,6 +21,7 @@
 #include "strvec.h"
 #include "object-file.h"
 #include "object-store.h"
+#include "path.h"
 #include "replace-object.h"
 #include "tmp-objdir.h"
 #include "chdir-notify.h"
fetch-pack.c +1 -0
index 0f71054fbae..207548b3e5a 100644
@@ -25,6 +25,7 @@
 #include "oidset.h"
 #include "packfile.h"
 #include "object-store.h"
+#include "path.h"
 #include "connected.h"
 #include "fetch-negotiator.h"
 #include "fsck.h"
fsck.c +1 -0
index 3261ef9ec28..04e729953b2 100644
@@ -3,6 +3,7 @@
 #include "date.h"
 #include "hex.h"
 #include "object-store.h"
+#include "path.h"
 #include "repository.h"
 #include "object.h"
 #include "attr.h"
http-backend.c +1 -0
index ac146d85c54..ddb9549ecbc 100644
@@ -4,6 +4,7 @@
 #include "environment.h"
 #include "git-zlib.h"
 #include "hex.h"
+#include "path.h"
 #include "repository.h"
 #include "refs.h"
 #include "pkt-line.h"
merge-ort.c +1 -0
index c2d2ee73eaa..eed71b04389 100644
@@ -36,6 +36,7 @@
 #include "object-name.h"
 #include "object-store.h"
 #include "oid-array.h"
+#include "path.h"
 #include "promisor-remote.h"
 #include "read-cache-ll.h"
 #include "revision.h"
merge-recursive.c +1 -0
index 4bef9b62fa8..527dbbd010a 100644
@@ -27,6 +27,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "repository.h"
 #include "revision.h"
 #include "sparse-index.h"
notes-merge.c +1 -0
index 233e49e3195..4b328d852cd 100644
@@ -6,6 +6,7 @@
 #include "object-file.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "repository.h"
 #include "diff.h"
 #include "diffcore.h"
object-file.c +1 -0
index 7c1af5c8db8..8d87720dd53 100644
@@ -39,6 +39,7 @@
 #include "object-file.h"
 #include "object-store.h"
 #include "oidtree.h"
+#include "path.h"
 #include "promisor-remote.h"
 #include "setup.h"
 #include "submodule.h"
pack-bitmap-write.c +1 -0
index cdffe2ce47d..623ee2a8197 100644
@@ -15,6 +15,7 @@
 #include "pack-bitmap.h"
 #include "hash-lookup.h"
 #include "pack-objects.h"
+#include "path.h"
 #include "commit-reach.h"
 #include "prio-queue.h"
 #include "trace2.h"
pack-write.c +1 -0
index 3b3ce89de6e..45681e2d7db 100644
@@ -10,6 +10,7 @@
 #include "oidmap.h"
 #include "pack-objects.h"
 #include "pack-revindex.h"
+#include "path.h"
 #include "wrapper.h"
 
 void reset_pack_idx_option(struct pack_idx_option *opts)
read-cache.c +1 -0
index edab96765df..86ada403a83 100644
@@ -27,6 +27,7 @@
 #include "mem-pool.h"
 #include "name-hash.h"
 #include "object-name.h"
+#include "path.h"
 #include "preload-index.h"
 #include "read-cache.h"
 #include "resolve-undo.h"
refs.c +1 -0
index d2a98e1c21f..3c0c95ac442 100644
@@ -19,6 +19,7 @@
 #include "object-name.h"
 #include "object-store.h"
 #include "object.h"
+#include "path.h"
 #include "tag.h"
 #include "submodule.h"
 #include "worktree.h"
refs/files-backend.c +1 -0
index 01c08207619..6fa7decec0a 100644
@@ -15,6 +15,7 @@
 #include "../lockfile.h"
 #include "../object.h"
 #include "../object-file.h"
+#include "../path.h"
 #include "../dir.h"
 #include "../chdir-notify.h"
 #include "../setup.h"
remote.c +1 -0
index 0764fca0db9..8550056db43 100644
@@ -11,6 +11,7 @@
 #include "refspec.h"
 #include "object-name.h"
 #include "object-store.h"
+#include "path.h"
 #include "commit.h"
 #include "diff.h"
 #include "revision.h"
repository.c +1 -0
index 67ec56a70c5..87a7a27b665 100644
@@ -10,6 +10,7 @@
 #include "config.h"
 #include "object.h"
 #include "lockfile.h"
+#include "path.h"
 #include "read-cache-ll.h"
 #include "remote.h"
 #include "setup.h"
repository.h +0 -2
index 763794880ed..510aa6d9a2f 100644
@@ -1,8 +1,6 @@
 #ifndef REPOSITORY_H
 #define REPOSITORY_H
 
-#include "path.h"
-
 struct config_set;
 struct fsmonitor_settings;
 struct git_hash_algo;
rerere.c +1 -0
index 2fb93a51125..35b9785d573 100644
@@ -14,6 +14,7 @@
 #include "resolve-undo.h"
 #include "ll-merge.h"
 #include "attr.h"
+#include "path.h"
 #include "pathspec.h"
 #include "object-file.h"
 #include "object-store.h"
sequencer.c +1 -0
index 08bd0e81743..eddd38d4bed 100644
@@ -23,6 +23,7 @@
 #include "utf8.h"
 #include "cache-tree.h"
 #include "diff.h"
+#include "path.h"
 #include "revision.h"
 #include "rerere.h"
 #include "merge.h"
server-info.c +1 -0
index 55aa04f00ab..85d17bbb151 100644
@@ -9,6 +9,7 @@
 #include "commit.h"
 #include "tag.h"
 #include "packfile.h"
+#include "path.h"
 #include "object-file.h"
 #include "object-store.h"
 #include "server-info.h"
setup.c +1 -0
index 1cc1f3b3978..68041c0dc88 100644
@@ -12,6 +12,7 @@
 #include "setup.h"
 #include "string-list.h"
 #include "chdir-notify.h"
+#include "path.h"
 #include "promisor-remote.h"
 #include "quote.h"
 #include "trace2.h"
shallow.c +1 -0
index f1c93e74648..45343e6a78b 100644
@@ -11,6 +11,7 @@
 #include "remote.h"
 #include "refs.h"
 #include "oid-array.h"
+#include "path.h"
 #include "diff.h"
 #include "revision.h"
 #include "commit-slab.h"
strbuf.c +1 -0
index 08eec8f1d8b..d070e007f8a 100644
@@ -6,6 +6,7 @@
 #include "hex.h"
 #include "object-name.h"
 #include "refs.h"
+#include "path.h"
 #include "repository.h"
 #include "string-list.h"
 #include "utf8.h"
submodule-config.c +1 -0
index 58dfbde9ae5..c67260a3e11 100644
@@ -4,6 +4,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
+#include "path.h"
 #include "repository.h"
 #include "config.h"
 #include "submodule-config.h"
submodule.c +1 -0
index 20aa8ed0fb8..245300596ff 100644
@@ -20,6 +20,7 @@
 #include "strvec.h"
 #include "blob.h"
 #include "thread-utils.h"
+#include "path.h"
 #include "quote.h"
 #include "remote.h"
 #include "worktree.h"
t/helper/test-ref-store.c +1 -0
index 6d8f844e9c7..1b30a6cba8b 100644
@@ -4,6 +4,7 @@
 #include "setup.h"
 #include "worktree.h"
 #include "object-store.h"
+#include "path.h"
 #include "repository.h"
 
 struct flag_definition {
tmp-objdir.c +1 -0
index c33a554f921..db1f7038dae 100644
@@ -5,6 +5,7 @@
 #include "dir.h"
 #include "environment.h"
 #include "object-file.h"
+#include "path.h"
 #include "sigchain.h"
 #include "string-list.h"
 #include "strbuf.h"
worktree.c +1 -0
index b5ee71c5ebd..f9aa371ca70 100644
@@ -3,6 +3,7 @@
 #include "alloc.h"
 #include "environment.h"
 #include "gettext.h"
+#include "path.h"
 #include "repository.h"
 #include "refs.h"
 #include "setup.h"
wt-status.c +1 -0
index 6ee8567ac2d..7ada6b305f6 100644
@@ -9,6 +9,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-name.h"
+#include "path.h"
 #include "revision.h"
 #include "diffcore.h"
 #include "quote.h"
Signature · 1 line
gitgitgadget
#104 lore raw

PATCH v3 20/28 diff.h: remove unnecessary include of oidset.h

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

This also made it clear that several .c files depended upon various things that oidset included, but had omitted the direct #include for those headers. Add those now.

---
 add-interactive.c                | 2 ++
 add-patch.c                      | 1 +
 blame.h                          | 1 +
 builtin/add.c                    | 1 +
 builtin/diff-files.c             | 1 +
 builtin/diff-index.c             | 1 +
 builtin/merge-ours.c             | 1 +
 builtin/patch-id.c               | 1 +
 builtin/range-diff.c             | 1 +
 builtin/reflog.c                 | 1 +
 builtin/reset.c                  | 1 +
 builtin/rev-parse.c              | 1 +
 builtin/revert.c                 | 1 +
 builtin/shortlog.c               | 1 +
 builtin/stash.c                  | 1 +
 diff-lib.c                       | 2 ++
 diff.h                           | 4 +++-
 diffcore-break.c                 | 1 +
 diffcore-pickaxe.c               | 1 +
 line-log.c                       | 1 +
 merge.c                          | 2 ++
 patch-ids.c                      | 1 +
 pretty.c                         | 1 +
 range-diff.c                     | 1 +
 reflog-walk.c                    | 1 +
 t/helper/test-fast-rebase.c      | 1 +
 t/helper/test-revision-walking.c | 1 +
 transport-helper.c               | 1 +
 tree-diff.c                      | 1 +
 wt-status.c                      | 1 +
 30 files changed, 35 insertions(+), 1 deletion(-)
add-interactive.c +2 -0
index 40f88c02051..add9a1ad436 100644
@@ -4,9 +4,11 @@
 #include "config.h"
 #include "diffcore.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "preload-index.h"
 #include "read-cache-ll.h"
+#include "repository.h"
 #include "revision.h"
 #include "refs.h"
 #include "string-list.h"
add-patch.c +1 -0
index 875b96e2274..53e32482959 100644
@@ -7,6 +7,7 @@
 #include "gettext.h"
 #include "object-name.h"
 #include "read-cache-ll.h"
+#include "repository.h"
 #include "strbuf.h"
 #include "run-command.h"
 #include "strvec.h"
blame.h +1 -0
index b60d1d81e30..31ddc85f19e 100644
@@ -2,6 +2,7 @@
 #define BLAME_H
 
 #include "commit.h"
+#include "oidset.h"
 #include "xdiff-interface.h"
 #include "revision.h"
 #include "prio-queue.h"
builtin/add.c +1 -0
index 43183114487..e3ca3e4edbe 100644
@@ -21,6 +21,7 @@
 #include "diff.h"
 #include "diffcore.h"
 #include "read-cache.h"
+#include "repository.h"
 #include "revision.h"
 #include "bulk-checkin.h"
 #include "strvec.h"
builtin/diff-files.c +1 -0
index b7036aa7c2b..07f6dff844c 100644
@@ -9,6 +9,7 @@
 #include "diff-merges.h"
 #include "commit.h"
 #include "preload-index.h"
+#include "repository.h"
 #include "revision.h"
 #include "submodule.h"
 
builtin/diff-index.c +1 -0
index 1ab8f8b6dc5..a8b2c0a4b96 100644
@@ -4,6 +4,7 @@
 #include "diff-merges.h"
 #include "commit.h"
 #include "preload-index.h"
+#include "repository.h"
 #include "revision.h"
 #include "setup.h"
 #include "submodule.h"
builtin/merge-ours.c +1 -0
index c2e519301e9..932924e5d0e 100644
@@ -10,6 +10,7 @@
 #include "git-compat-util.h"
 #include "builtin.h"
 #include "diff.h"
+#include "repository.h"
 
 static const char builtin_merge_ours_usage[] =
 	"git merge-ours <base>... -- HEAD <remote>...";
builtin/patch-id.c +1 -0
index 27952f1a6fd..b7118b290b1 100644
@@ -2,6 +2,7 @@
 #include "config.h"
 #include "diff.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "parse-options.h"
 
builtin/range-diff.c +1 -0
index 8610390d7c5..e455a4795cc 100644
@@ -4,6 +4,7 @@
 #include "parse-options.h"
 #include "range-diff.h"
 #include "config.h"
+#include "repository.h"
 #include "revision.h"
 
 static const char * const builtin_range_diff_usage[] = {
builtin/reflog.c +1 -0
index a1fa0c855f4..fc217748808 100644
@@ -1,6 +1,7 @@
 #include "builtin.h"
 #include "config.h"
 #include "gettext.h"
+#include "repository.h"
 #include "revision.h"
 #include "reachable.h"
 #include "worktree.h"
builtin/reset.c +1 -0
index f947c449d14..dad2117c974 100644
@@ -13,6 +13,7 @@
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "tag.h"
builtin/rev-parse.c +1 -0
index 6eb5965bee4..4a219ea93bb 100644
@@ -11,6 +11,7 @@
 #include "commit.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "refs.h"
 #include "quote.h"
builtin/revert.c +1 -0
index 0240ec8593b..f6f07d9b539 100644
@@ -5,6 +5,7 @@
 #include "parse-options.h"
 #include "diff.h"
 #include "gettext.h"
+#include "repository.h"
 #include "revision.h"
 #include "rerere.h"
 #include "dir.h"
builtin/shortlog.c +1 -0
index 99be9dc417d..1307ed2b88a 100644
@@ -5,6 +5,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "string-list.h"
+#include "repository.h"
 #include "revision.h"
 #include "utf8.h"
 #include "mailmap.h"
builtin/stash.c +1 -0
index d3d5bb95e26..84e83e0627f 100644
@@ -4,6 +4,7 @@
 #include "config.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "object-name.h"
 #include "parse-options.h"
diff-lib.c +2 -0
index f3aa7f93c78..cad18099aba 100644
@@ -7,6 +7,7 @@
 #include "diff.h"
 #include "diffcore.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "object-name.h"
 #include "read-cache.h"
@@ -14,6 +15,7 @@
 #include "cache-tree.h"
 #include "unpack-trees.h"
 #include "refs.h"
+#include "repository.h"
 #include "submodule.h"
 #include "symlinks.h"
 #include "trace.h"
diff.h +3 -1
index 29a9cd217c2..c2e0e63609f 100644
@@ -4,10 +4,12 @@
 #ifndef DIFF_H
 #define DIFF_H
 
+#include "hash-ll.h"
 #include "pathspec.h"
-#include "oidset.h"
 #include "strbuf.h"
 
+struct oidset;
+
 /**
  * The diff API is for programs that compare two sets of files (e.g. two trees,
  * one tree and the index) and present the found difference in various ways.
diffcore-break.c +1 -0
index 4909dc088e6..f57ece2757d 100644
@@ -4,6 +4,7 @@
 #include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "hash.h"
 #include "object.h"
 #include "promisor-remote.h"
 
diffcore-pickaxe.c +1 -0
index 13c98a7b5e7..b195fa4eb3c 100644
@@ -7,6 +7,7 @@
 #include "diffcore.h"
 #include "xdiff-interface.h"
 #include "kwset.h"
+#include "oidset.h"
 #include "pretty.h"
 #include "quote.h"
 
line-log.c +1 -0
index 6a7ac312a43..2eff914bf36 100644
@@ -8,6 +8,7 @@
 #include "diff.h"
 #include "commit.h"
 #include "decorate.h"
+#include "repository.h"
 #include "revision.h"
 #include "xdiff-interface.h"
 #include "strbuf.h"
merge.c +2 -0
index 83bcba6943e..b60925459c2 100644
@@ -2,10 +2,12 @@
 #include "diff.h"
 #include "diffcore.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "merge.h"
 #include "commit.h"
+#include "repository.h"
 #include "run-command.h"
 #include "resolve-undo.h"
 #include "tree.h"
patch-ids.c +1 -0
index 19af7bee984..c3e1a0dd216 100644
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "diff.h"
 #include "commit.h"
+#include "hash.h"
 #include "hash-lookup.h"
 #include "hex.h"
 #include "patch-ids.h"
pretty.c +1 -0
index 0bb938021ba..2cf2cbbd038 100644
@@ -4,6 +4,7 @@
 #include "commit.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "utf8.h"
 #include "diff.h"
range-diff.c +1 -0
index 6a704e6f471..2e86063491e 100644
@@ -13,6 +13,7 @@
 #include "commit.h"
 #include "pager.h"
 #include "pretty.h"
+#include "repository.h"
 #include "userdiff.h"
 #include "apply.h"
 #include "revision.h"
reflog-walk.c +1 -0
index 4ba1a10c82c..d337e64431f 100644
@@ -3,6 +3,7 @@
 #include "commit.h"
 #include "refs.h"
 #include "diff.h"
+#include "repository.h"
 #include "revision.h"
 #include "string-list.h"
 #include "reflog-walk.h"
t/helper/test-fast-rebase.c +1 -0
index 62c5b5d704b..cac20a72b3f 100644
@@ -16,6 +16,7 @@
 #include "commit.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "lockfile.h"
 #include "merge-ort.h"
t/helper/test-revision-walking.c +1 -0
index 0c62b9de185..f346951bc28 100644
@@ -11,6 +11,7 @@
 #include "test-tool.h"
 #include "commit.h"
 #include "diff.h"
+#include "repository.h"
 #include "revision.h"
 #include "setup.h"
 
transport-helper.c +1 -0
index 6b816940dc6..5c0bc6a896e 100644
@@ -8,6 +8,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-name.h"
+#include "repository.h"
 #include "revision.h"
 #include "remote.h"
 #include "string-list.h"
tree-diff.c +1 -0
index 20bb15f38d9..966946848ae 100644
@@ -4,6 +4,7 @@
 #include "git-compat-util.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "hash.h"
 #include "tree.h"
 #include "tree-walk.h"
 
wt-status.c +1 -0
index 7ada6b305f6..bcd0ef80441 100644
@@ -7,6 +7,7 @@
 #include "diff.h"
 #include "environment.h"
 #include "gettext.h"
+#include "hash.h"
 #include "hex.h"
 #include "object-name.h"
 #include "path.h"
Signature · 1 line
gitgitgadget
#105 lore raw

PATCH v3 21/28 list-objects-filter-options.h: remove unneccessary include

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

---
 list-objects-filter-options.h | 1 -
 1 file changed, 1 deletion(-)
list-objects-filter-options.h +0 -1
index f6206125868..55fab8563d2 100644
@@ -3,7 +3,6 @@
 
 #include "gettext.h"
 #include "object.h"
-#include "string-list.h"
 #include "strbuf.h"
 
 struct option;
Signature · 1 line
gitgitgadget
#106 lore raw

PATCH v3 22/28 builtin.h: remove unneccessary includes

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

This also made it clear that a few .c files under builtin/ were depending upon some headers but had forgotten to #include them. Add the missing direct includes while at it.

---
 builtin.h                  | 2 --
 builtin/check-mailmap.c    | 1 +
 builtin/commit-graph.c     | 1 +
 builtin/config.c           | 1 +
 builtin/credential-cache.c | 1 +
 builtin/for-each-ref.c     | 1 +
 builtin/init-db.c          | 1 +
 builtin/verify-pack.c      | 1 +
 8 files changed, 7 insertions(+), 2 deletions(-)
builtin.h +0 -2
index 3e6c22eef69..d560baa6618 100644
@@ -2,8 +2,6 @@
 #define BUILTIN_H
 
 #include "git-compat-util.h"
-#include "strbuf.h"
-#include "commit.h"
 
 /*
  * builtin API
builtin/check-mailmap.c +1 -0
index 002d2941e93..b8a05b8e07b 100644
@@ -4,6 +4,7 @@
 #include "ident.h"
 #include "mailmap.h"
 #include "parse-options.h"
+#include "strbuf.h"
 #include "string-list.h"
 #include "write-or-die.h"
 
builtin/commit-graph.c +1 -0
index a3d00fa232b..96a8a677327 100644
@@ -1,4 +1,5 @@
 #include "builtin.h"
+#include "commit.h"
 #include "config.h"
 #include "dir.h"
 #include "environment.h"
builtin/config.c +1 -0
index ff2fe8ef125..30f6d9fe67b 100644
@@ -12,6 +12,7 @@
 #include "path.h"
 #include "quote.h"
 #include "setup.h"
+#include "strbuf.h"
 #include "worktree.h"
 #include "wrapper.h"
 
builtin/credential-cache.c +1 -0
index 0ffacfdd83c..ff3a47badbe 100644
@@ -2,6 +2,7 @@
 #include "gettext.h"
 #include "parse-options.h"
 #include "path.h"
+#include "strbuf.h"
 #include "wrapper.h"
 #include "write-or-die.h"
 
builtin/for-each-ref.c +1 -0
index d0d6ab0fd34..15409337f83 100644
@@ -5,6 +5,7 @@
 #include "object.h"
 #include "parse-options.h"
 #include "ref-filter.h"
+#include "strbuf.h"
 #include "strvec.h"
 #include "commit-reach.h"
 
builtin/init-db.c +1 -0
index 680ef7e1837..0d8bd4d7219 100644
@@ -12,6 +12,7 @@
 #include "parse-options.h"
 #include "path.h"
 #include "setup.h"
+#include "strbuf.h"
 #include "wrapper.h"
 
 static int guess_repository_type(const char *git_dir)
builtin/verify-pack.c +1 -0
index aba92cf8af7..011dddd2dc3 100644
@@ -3,6 +3,7 @@
 #include "gettext.h"
 #include "run-command.h"
 #include "parse-options.h"
+#include "strbuf.h"
 
 #define VERIFY_PACK_VERBOSE 01
 #define VERIFY_PACK_STAT_ONLY 02
Signature · 1 line
gitgitgadget
#107 lore raw

PATCH v3 23/28 git-compat-util.h: remove unneccessary include of wildmatch.h

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

The include of wildmatch.h in git-compat-util.h was added in cebcab189aa (Makefile: add USE_WILDMATCH to use wildmatch as fnmatch, 2013-01-01) as a way to be able to compile-time force any calls to fnmatch() to instead invoke wildmatch(). The defines and inline function were removed in 70a8fc999d9 (stop using fnmatch (either native or compat), 2014-02-15), and this include in git-compat-util.h has been unnecessary ever since.

Remove the include from git-compat-util.h, but add it to the .c files that had omitted the direct #include they needed.

---
 apply.c                   | 1 +
 builtin/describe.c        | 1 +
 builtin/ls-remote.c       | 1 +
 builtin/name-rev.c        | 1 +
 builtin/reflog.c          | 1 +
 builtin/replace.c         | 1 +
 builtin/show-branch.c     | 1 +
 config.c                  | 1 +
 diffcore-order.c          | 1 +
 fmt-merge-msg.c           | 1 +
 git-compat-util.h         | 2 --
 log-tree.c                | 1 +
 pathspec.c                | 1 +
 refs.c                    | 1 +
 revision.c                | 1 +
 t/helper/test-wildmatch.c | 1 +
 trace2/tr2_cfg.c          | 1 +
 17 files changed, 16 insertions(+), 2 deletions(-)
apply.c +1 -0
index be58dc08d22..801f2bcc99c 100644
@@ -35,6 +35,7 @@
 #include "entry.h"
 #include "setup.h"
 #include "symlinks.h"
+#include "wildmatch.h"
 #include "ws.h"
 #include "wrapper.h"
 
builtin/describe.c +1 -0
index 508e8df00ef..eb19ab0bbbe 100644
@@ -22,6 +22,7 @@
 #include "object-store.h"
 #include "list-objects.h"
 #include "commit-slab.h"
+#include "wildmatch.h"
 
 #define MAX_TAGS	(FLAG_BITS - 1)
 
builtin/ls-remote.c +1 -0
index a0aadc9b8ff..fc765754305 100644
@@ -7,6 +7,7 @@
 #include "remote.h"
 #include "refs.h"
 #include "parse-options.h"
+#include "wildmatch.h"
 
 static const char * const ls_remote_usage[] = {
 	N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=<exec>]\n"
builtin/name-rev.c +1 -0
index 593f0506a10..de9808e21c8 100644
@@ -15,6 +15,7 @@
 #include "hash-lookup.h"
 #include "commit-slab.h"
 #include "commit-graph.h"
+#include "wildmatch.h"
 
 /*
  * One day.  See the 'name a rev shortly after epoch' test in t6120 when
builtin/reflog.c +1 -0
index fc217748808..79b4ff04aae 100644
@@ -4,6 +4,7 @@
 #include "repository.h"
 #include "revision.h"
 #include "reachable.h"
+#include "wildmatch.h"
 #include "worktree.h"
 #include "reflog.h"
 #include "parse-options.h"
builtin/replace.c +1 -0
index 6b266a66d30..a2f57a56b3e 100644
@@ -24,6 +24,7 @@
 #include "replace-object.h"
 #include "repository.h"
 #include "tag.h"
+#include "wildmatch.h"
 
 static const char * const git_replace_usage[] = {
 	N_("git replace [-f] <object> <replacement>"),
builtin/show-branch.c +1 -0
index cd215f89af8..a203f13cb0d 100644
@@ -14,6 +14,7 @@
 #include "dir.h"
 #include "commit-slab.h"
 #include "date.h"
+#include "wildmatch.h"
 
 static const char* show_branch_usage[] = {
     N_("git show-branch [-a | --all] [-r | --remotes] [--topo-order | --date-order]\n"
config.c +1 -0
index 666ec73bab1..0b2a9f1bd89 100644
@@ -36,6 +36,7 @@
 #include "setup.h"
 #include "strvec.h"
 #include "trace2.h"
+#include "wildmatch.h"
 #include "worktree.h"
 #include "ws.h"
 #include "wrapper.h"
diffcore-order.c +1 -0
index 57ccab28464..e7d20ebd2d1 100644
@@ -5,6 +5,7 @@
 #include "gettext.h"
 #include "diff.h"
 #include "diffcore.h"
+#include "wildmatch.h"
 
 static char **order;
 static int order_cnt;
fmt-merge-msg.c +1 -0
index 5af0d4715ba..f096b1ef549 100644
@@ -15,6 +15,7 @@
 #include "fmt-merge-msg.h"
 #include "commit-reach.h"
 #include "gpg-interface.h"
+#include "wildmatch.h"
 
 static int use_branch_desc;
 static int suppress_dest_pattern_seen;
git-compat-util.h +0 -2
index 5b2b99c17c5..1889da7986e 100644
@@ -625,8 +625,6 @@ static inline int git_has_dir_sep(const char *path)
 
 #include "compat/bswap.h"
 
-#include "wildmatch.h"
-
 struct strbuf;
 
 /* General helper functions */
log-tree.c +1 -0
index 07d0b47b168..60b61597c42 100644
@@ -26,6 +26,7 @@
 #include "range-diff.h"
 #include "strmap.h"
 #include "tree.h"
+#include "wildmatch.h"
 #include "write-or-die.h"
 
 static struct decoration name_decoration = { "object names" };
pathspec.c +1 -0
index 0baa85384f8..ad9b9e7dc74 100644
@@ -12,6 +12,7 @@
 #include "strvec.h"
 #include "symlinks.h"
 #include "quote.h"
+#include "wildmatch.h"
 
 /*
  * Finds which of the given pathspecs match items in the index.
refs.c +1 -0
index 3c0c95ac442..5f76da35673 100644
@@ -29,6 +29,7 @@
 #include "sigchain.h"
 #include "date.h"
 #include "commit.h"
+#include "wildmatch.h"
 #include "wrapper.h"
 
 /*
revision.c +1 -0
index 66a1fece0df..d4b4b34fd80 100644
@@ -46,6 +46,7 @@
 #include "list-objects-filter-options.h"
 #include "resolve-undo.h"
 #include "parse-options.h"
+#include "wildmatch.h"
 
 volatile show_early_output_fn_t show_early_output;
 
t/helper/test-wildmatch.c +1 -0
index a95bb4da9b1..b4ff5f986ae 100644
@@ -1,4 +1,5 @@
 #include "test-tool.h"
+#include "wildmatch.h"
 
 int cmd__wildmatch(int argc, const char **argv)
 {
trace2/tr2_cfg.c +1 -0
index 78cfc15d52d..db817a80c53 100644
@@ -4,6 +4,7 @@
 #include "trace2.h"
 #include "trace2/tr2_cfg.h"
 #include "trace2/tr2_sysenv.h"
+#include "wildmatch.h"
 
 static struct strbuf **tr2_cfg_patterns;
 static int tr2_cfg_count_patterns;
Signature · 1 line
gitgitgadget
#108 lore raw

PATCH v3 24/28 merge-ll: rename from ll-merge

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

A long term (but rather minor) pet-peeve of mine was the name ll-merge.[ch]. I thought it made it harder to realize what stuff was related to merging when I was working on the merge machinery and trying to improve it.

Further, back in d1cbe1e6d8a ("hash-ll.h: split out of hash.h to remove dependency on repository.h", 2023-04-22), we have split the portions of hash.h that do not depend upon repository.h into a "hash-ll.h" (due to the recommendation to use "ll" for "low-level" in its name[1], but which I used as a suffix precisely because of my distaste for "ll-merge"). When we discussed adding additional "*-ll.h" files, a request was made that we use "ll" consistently as either a prefix or a suffix. Since it is already in use as both a prefix and a suffix, the only way to do so is to rename some files.

Besides my distaste for the ll-merge.[ch] name, let me also note that the files
ll-fsmonitor.h, ll-hash.h, ll-merge.h, ll-object-store.h, ll-read-cache.h
would have essentially nothing to do with each other and make no sense to group. But giving them the common "ll-" prefix would group them. Using "-ll" as a suffix thus seems just much more logical to me. Rename ll-merge.[ch] to merge-ll.[ch] to achieve this consistency, and to ensure we get a more logical grouping of files.

[1] https://lore.kernel.org/git/[email protected]/

---
 Documentation/technical/api-merge.txt | 4 ++--
 Makefile                              | 2 +-
 apply.c                               | 2 +-
 builtin/checkout.c                    | 2 +-
 convert.c                             | 2 +-
 diff.c                                | 2 +-
 merge-blobs.c                         | 2 +-
 ll-merge.c => merge-ll.c              | 2 +-
 ll-merge.h => merge-ll.h              | 0
 merge-ort.c                           | 2 +-
 merge-recursive.c                     | 2 +-
 notes-merge.c                         | 2 +-
 rerere.c                              | 2 +-
 13 files changed, 13 insertions(+), 13 deletions(-)
 rename ll-merge.c => merge-ll.c (99%)
 rename ll-merge.h => merge-ll.h (100%)
Documentation/technical/api-merge.txt +2 -2
index 487d4d83fff..c2ba01828c6 100644
@@ -28,9 +28,9 @@ and `diff.c` for examples.
 
 * `struct ll_merge_options`
 
-Check ll-merge.h for details.
+Check merge-ll.h for details.
 
 Low-level (single file) merge
 -----------------------------
 
-Check ll-merge.h for details.
+Check merge-ll.h for details.
Makefile +1 -1
index 2d180abc5ca..045e2187c41 100644
@@ -1051,7 +1051,6 @@ LIB_OBJS += linear-assignment.o
 LIB_OBJS += list-objects-filter-options.o
 LIB_OBJS += list-objects-filter.o
 LIB_OBJS += list-objects.o
-LIB_OBJS += ll-merge.o
 LIB_OBJS += lockfile.o
 LIB_OBJS += log-tree.o
 LIB_OBJS += ls-refs.o
@@ -1060,6 +1059,7 @@ LIB_OBJS += mailmap.o
 LIB_OBJS += match-trees.o
 LIB_OBJS += mem-pool.o
 LIB_OBJS += merge-blobs.o
+LIB_OBJS += merge-ll.o
 LIB_OBJS += merge-ort.o
 LIB_OBJS += merge-ort-wrappers.o
 LIB_OBJS += merge-recursive.o
apply.c +1 -1
index 801f2bcc99c..2f66f93fec5 100644
@@ -21,7 +21,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "lockfile.h"
 #include "name-hash.h"
 #include "object-name.h"
builtin/checkout.c +1 -1
index 716dcd4cae1..11e2359c548 100644
@@ -13,7 +13,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "hook.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "lockfile.h"
 #include "mem-pool.h"
 #include "merge-recursive.h"
convert.c +1 -1
index 9e89f660308..1f2cfc5f457 100644
@@ -15,7 +15,7 @@
 #include "sub-process.h"
 #include "trace.h"
 #include "utf8.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "wrapper.h"
 
 /*
diff.c +1 -1
index 5e81dc0d02d..9d6b88ece90 100644
@@ -26,7 +26,7 @@
 #include "submodule.h"
 #include "hashmap.h"
 #include "mem-pool.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "string-list.h"
 #include "strvec.h"
 #include "graph.h"
merge-blobs.c +1 -1
index 5632ff6abb6..40c48e3eba6 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "run-command.h"
 #include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "blob.h"
 #include "merge-blobs.h"
 #include "object-store.h"
merge-ll.c renamed from ll-merge.c +1 -1
similarity index 99%
rename from ll-merge.c
rename to merge-ll.c
index 1993530688e..c076d048407 100644
@@ -10,7 +10,7 @@
 #include "attr.h"
 #include "xdiff-interface.h"
 #include "run-command.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "quote.h"
 #include "strbuf.h"
 #include "wrapper.h"
merge-ll.h renamed from ll-merge.h +0 -0
similarity index 100%
rename from ll-merge.h
rename to merge-ll.h
merge-ort.c +1 -1
index eed71b04389..f4522951323 100644
@@ -30,7 +30,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "entry.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "match-trees.h"
 #include "mem-pool.h"
 #include "object-name.h"
merge-recursive.c +1 -1
index 527dbbd010a..35e1e7e1bef 100644
@@ -20,7 +20,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "lockfile.h"
 #include "match-trees.h"
 #include "name-hash.h"
notes-merge.c +1 -1
index 4b328d852cd..4be11a01550 100644
@@ -12,7 +12,7 @@
 #include "diffcore.h"
 #include "hex.h"
 #include "xdiff-interface.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "dir.h"
 #include "notes.h"
 #include "notes-merge.h"
rerere.c +1 -1
index 35b9785d573..3584fecb07c 100644
@@ -12,7 +12,7 @@
 #include "xdiff-interface.h"
 #include "dir.h"
 #include "resolve-undo.h"
-#include "ll-merge.h"
+#include "merge-ll.h"
 #include "attr.h"
 #include "path.h"
 #include "pathspec.h"
Signature · 1 line
gitgitgadget
#109 lore raw

PATCH v3 25/28 khash: name the structs that khash declares

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

khash.h lets you instantiate custom hash types that map between two types. These are defined as a struct, as you might expect, and khash typedef's that to kh_foo_t. But it declares the struct anonymously, which doesn't give a name to the struct type itself; there is no "struct kh_foo". This has two small downsides:

- when using khash, we declare "kh_foo_t *the_foo". This is unlike our usual naming style, which is "struct kh_foo *the_foo".

- you can't forward-declare a typedef of an unnamed struct type in C. So we might do something like this in a header file:

struct kh_foo;
struct bar {
struct kh_foo *the_foo;
};

to avoid having to include the header that defines the real kh_foo. But that doesn't work with the typedef'd name. Without the "struct" keyword, the compiler doesn't know we mean that kh_foo is a type.

So let's always give khash structs the name that matches our conventions ("struct kh_foo" to match "kh_foo_t"). We'll keep doing the typedef to retain compatibility with existing callers.

---
 khash.h        | 2 +-
 object-store.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
khash.h +1 -1
index 56241e6a5c9..a0a08dad8b7 100644
@@ -62,7 +62,7 @@ static inline khint_t __ac_X31_hash_string(const char *s)
 static const double __ac_HASH_UPPER = 0.77;
 
 #define __KHASH_TYPE(name, khkey_t, khval_t) \
-	typedef struct { \
+	typedef struct kh_##name { \
 		khint_t n_buckets, size, n_occupied, upper_bound; \
 		khint32_t *flags; \
 		khkey_t *keys; \
object-store.h +1 -1
index 12415e5ea73..05803a03e92 100644
@@ -164,7 +164,7 @@ struct raw_object_store {
 	 */
 	struct object_directory *odb;
 	struct object_directory **odb_tail;
-	kh_odb_path_map_t *odb_by_path;
+	struct kh_odb_path_map *odb_by_path;
 
 	int loaded_alternates;
 
Signature · 1 line
gitgitgadget
#110 lore raw

PATCH v3 26/28 object-store-ll.h: split this header out of object-store.h

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

The vast majority of files including object-store.h did not need dir.h nor khash.h. Split the header into two files, and let most just depend upon object-store-ll.h, while letting the two callers that need it depend on the full object-store.h.

After this patch:

    $ git grep -h include..object-store | sort | uniq -c
          2 #include "object-store.h"
        129 #include "object-store-ll.h"

Diff best viewed with --color-moved.

---
 apply.c                       |   2 +-
 archive-tar.c                 |   2 +-
 archive-zip.c                 |   2 +-
 archive.c                     |   2 +-
 attr.c                        |   2 +-
 bisect.c                      |   2 +-
 blame.c                       |   2 +-
 builtin/blame.c               |   2 +-
 builtin/cat-file.c            |   2 +-
 builtin/checkout.c            |   2 +-
 builtin/clone.c               |   2 +-
 builtin/commit-graph.c        |   2 +-
 builtin/commit-tree.c         |   2 +-
 builtin/count-objects.c       |   2 +-
 builtin/describe.c            |   2 +-
 builtin/difftool.c            |   2 +-
 builtin/fast-export.c         |   2 +-
 builtin/fast-import.c         |   2 +-
 builtin/fetch.c               |   2 +-
 builtin/fsck.c                |   2 +-
 builtin/gc.c                  |   2 +-
 builtin/grep.c                |   2 +-
 builtin/hash-object.c         |   3 +-
 builtin/index-pack.c          |   3 +-
 builtin/log.c                 |   2 +-
 builtin/ls-tree.c             |   2 +-
 builtin/merge-tree.c          |   2 +-
 builtin/mktag.c               |   3 +-
 builtin/mktree.c              |   3 +-
 builtin/multi-pack-index.c    |   3 +-
 builtin/notes.c               |   2 +-
 builtin/pack-objects.c        |   2 +-
 builtin/pack-redundant.c      |   2 +-
 builtin/prune.c               |   3 +-
 builtin/receive-pack.c        |   2 +-
 builtin/remote.c              |   2 +-
 builtin/repack.c              |   2 +-
 builtin/replace.c             |   2 +-
 builtin/rev-list.c            |   2 +-
 builtin/show-ref.c            |   2 +-
 builtin/submodule--helper.c   |   2 +-
 builtin/tag.c                 |   2 +-
 builtin/unpack-file.c         |   2 +-
 builtin/unpack-objects.c      |   2 +-
 builtin/verify-commit.c       |   2 +-
 bulk-checkin.c                |   2 +-
 bundle-uri.c                  |   2 +-
 bundle.c                      |   2 +-
 cache-tree.c                  |   2 +-
 combine-diff.c                |   2 +-
 commit-graph.c                |   2 +-
 commit-graph.h                |   2 +-
 commit.c                      |   2 +-
 config.c                      |   2 +-
 connected.c                   |   2 +-
 convert.c                     |   2 +-
 diagnose.c                    |   2 +-
 diff.c                        |   2 +-
 diffcore-rename.c             |   2 +-
 dir.c                         |   2 +-
 entry.c                       |   2 +-
 environment.c                 |   2 +-
 fetch-pack.c                  |   2 +-
 fmt-merge-msg.c               |   2 +-
 fsck.c                        |   3 +-
 grep.c                        |   2 +-
 http-backend.c                |   2 +-
 http-push.c                   |   2 +-
 http-walker.c                 |   2 +-
 http.c                        |   2 +-
 list-objects-filter.c         |   2 +-
 list-objects.c                |   2 +-
 log-tree.c                    |   2 +-
 mailmap.c                     |   2 +-
 match-trees.c                 |   3 +-
 merge-blobs.c                 |   2 +-
 merge-ort.c                   |   2 +-
 merge-recursive.c             |   2 +-
 midx.c                        |   2 +-
 notes-cache.c                 |   3 +-
 notes-merge.c                 |   2 +-
 notes.c                       |   2 +-
 object-name.c                 |   2 +-
 object-store-ll.h             | 533 ++++++++++++++++++++++++++++++++++
 object-store.h                | 528 +--------------------------------
 oss-fuzz/fuzz-pack-idx.c      |   2 +-
 pack-bitmap-write.c           |   2 +-
 pack-bitmap.c                 |   2 +-
 pack-check.c                  |   2 +-
 pack-mtimes.c                 |   3 +-
 pack-objects.h                |   2 +-
 pack-revindex.c               |   3 +-
 pack-write.c                  |   1 +
 packfile.c                    |   2 +-
 path.c                        |   2 +-
 promisor-remote.c             |   2 +-
 protocol-caps.c               |   2 +-
 prune-packed.c                |   2 +-
 reachable.c                   |   2 +-
 read-cache.c                  |   2 +-
 ref-filter.c                  |   2 +-
 reflog.c                      |   2 +-
 refs.c                        |   2 +-
 remote.c                      |   2 +-
 replace-object.c              |   2 +-
 replace-object.h              |   2 +-
 repository.c                  |   2 +-
 rerere.c                      |   2 +-
 revision.c                    |   2 +-
 send-pack.c                   |   2 +-
 sequencer.c                   |   2 +-
 server-info.c                 |   2 +-
 shallow.c                     |   2 +-
 streaming.c                   |   2 +-
 submodule-config.c            |   2 +-
 submodule.c                   |   2 +-
 t/helper/test-pack-mtimes.c   |   2 +-
 t/helper/test-partial-clone.c |   2 +-
 t/helper/test-read-graph.c    |   2 +-
 t/helper/test-read-midx.c     |   2 +-
 t/helper/test-ref-store.c     |   3 +-
 t/helper/test-repository.c    |   2 +-
 tag.c                         |   2 +-
 tmp-objdir.c                  |   2 +-
 transport.c                   |   2 +-
 tree-walk.c                   |   2 +-
 tree.c                        |   2 +-
 unpack-trees.c                |   2 +-
 upload-pack.c                 |   2 +-
 walker.c                      |   3 +-
 xdiff-interface.c             |   3 +-
 131 files changed, 677 insertions(+), 655 deletions(-)
 create mode 100644 object-store-ll.h
apply.c +1 -1
index 2f66f93fec5..8bd0109fcc8 100644
@@ -12,7 +12,7 @@
 #include "alloc.h"
 #include "base85.h"
 #include "config.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "delta.h"
 #include "diff.h"
archive-tar.c +1 -1
index 4cd81d8161e..fc06ff4c5d6 100644
@@ -9,7 +9,7 @@
 #include "hex.h"
 #include "tar.h"
 #include "archive.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "streaming.h"
 #include "run-command.h"
 #include "write-or-die.h"
archive-zip.c +1 -1
index d0d065a312e..b4382640966 100644
@@ -9,7 +9,7 @@
 #include "hex.h"
 #include "streaming.h"
 #include "utf8.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "userdiff.h"
 #include "write-or-die.h"
 #include "xdiff-interface.h"
archive.c +1 -1
index 802a34d6b91..0e5065fd505 100644
@@ -10,7 +10,7 @@
 #include "pretty.h"
 #include "setup.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "tree.h"
 #include "tree-walk.h"
attr.c +1 -1
index 435b51e11ff..f178190c5de 100644
@@ -19,7 +19,7 @@
 #include "quote.h"
 #include "read-cache-ll.h"
 #include "revision.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "setup.h"
 #include "thread-utils.h"
 #include "tree-walk.h"
bisect.c +1 -1
index 9f7cf0be073..1be8e0a2711 100644
@@ -18,7 +18,7 @@
 #include "commit-slab.h"
 #include "commit-reach.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "dir.h"
 
blame.c +1 -1
index b74ee70decf..1d25cd29fce 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "cache-tree.h"
 #include "mergesort.h"
 #include "convert.h"
builtin/blame.c +1 -1
index 2df6039a6e0..e811e7fbfb1 100644
@@ -29,7 +29,7 @@
 #include "dir.h"
 #include "progress.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pager.h"
 #include "blame.h"
 #include "refs.h"
builtin/cat-file.c +1 -1
index 9646e7209ca..48ccca95a1a 100644
@@ -21,7 +21,7 @@
 #include "packfile.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
 #include "mailmap.h"
builtin/checkout.c +1 -1
index 11e2359c548..fd6ee8c2723 100644
@@ -18,7 +18,7 @@
 #include "mem-pool.h"
 #include "merge-recursive.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "parse-options.h"
 #include "path.h"
 #include "preload-index.h"
builtin/clone.c +1 -1
index 6c5cb33f6a9..687a686269a 100644
@@ -23,7 +23,7 @@
 #include "refs.h"
 #include "refspec.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "tree.h"
 #include "tree-walk.h"
 #include "unpack-trees.h"
builtin/commit-graph.c +1 -1
index 96a8a677327..48fa9f20c97 100644
@@ -9,7 +9,7 @@
 #include "parse-options.h"
 #include "repository.h"
 #include "commit-graph.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "progress.h"
 #include "replace-object.h"
 #include "tag.h"
builtin/commit-tree.c +1 -1
index d2121f30d45..02625e71761 100644
@@ -8,7 +8,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "commit.h"
 #include "tree.h"
builtin/count-objects.c +1 -1
index c9f82d0bce9..97cdfb0ac57 100644
@@ -14,7 +14,7 @@
 #include "parse-options.h"
 #include "quote.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static unsigned long garbage;
 static off_t size_garbage;
builtin/describe.c +1 -1
index eb19ab0bbbe..7ce23e1b8e6 100644
@@ -19,7 +19,7 @@
 #include "setup.h"
 #include "strvec.h"
 #include "run-command.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "list-objects.h"
 #include "commit-slab.h"
 #include "wildmatch.h"
builtin/difftool.c +1 -1
index 4a22de3eddb..e2c9ab7d5d7 100644
@@ -28,7 +28,7 @@
 #include "strbuf.h"
 #include "lockfile.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "dir.h"
 #include "entry.h"
 #include "setup.h"
builtin/fast-export.c +1 -1
index 5f3ffd6912f..56dc69fac18 100644
@@ -10,7 +10,7 @@
 #include "refs.h"
 #include "refspec.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "object.h"
 #include "tag.h"
builtin/fast-import.c +1 -1
index 5698b92ae7d..2ee19c73733 100644
@@ -21,7 +21,7 @@
 #include "packfile.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "mem-pool.h"
 #include "commit-reach.h"
 #include "khash.h"
builtin/fetch.c +1 -1
index 4dbacd8f188..86d409a6de3 100644
@@ -11,7 +11,7 @@
 #include "refs.h"
 #include "refspec.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oidset.h"
 #include "oid-array.h"
 #include "commit.h"
builtin/fsck.c +1 -1
index d707ca32a61..a04c15e5e81 100644
@@ -20,7 +20,7 @@
 #include "packfile.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "read-cache-ll.h"
 #include "replace-object.h"
builtin/gc.c +1 -1
index 9ecc2513e9f..7484946c506 100644
@@ -27,7 +27,7 @@
 #include "commit-graph.h"
 #include "packfile.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pack.h"
 #include "pack-objects.h"
 #include "path.h"
builtin/grep.c +1 -1
index 6bc8abcd3e1..72e70b3a48d 100644
@@ -27,7 +27,7 @@
 #include "submodule-config.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 #include "pager.h"
 #include "path.h"
builtin/hash-object.c +2 -1
index a3801211666..5ffec99dcea 100644
@@ -10,12 +10,13 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "quote.h"
 #include "parse-options.h"
 #include "exec-cmd.h"
 #include "setup.h"
+#include "strbuf.h"
 #include "write-or-die.h"
 
 /*
builtin/index-pack.c +2 -1
index bb67e166559..820860265d0 100644
@@ -14,12 +14,13 @@
 #include "progress.h"
 #include "fsck.h"
 #include "exec-cmd.h"
+#include "strbuf.h"
 #include "streaming.h"
 #include "thread-utils.h"
 #include "packfile.h"
 #include "pack-revindex.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oid-array.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
builtin/log.c +1 -1
index 676de107d61..d6543ba1f63 100644
@@ -14,7 +14,7 @@
 #include "refs.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pager.h"
 #include "color.h"
 #include "commit.h"
builtin/ls-tree.c +1 -1
index c06858de4bf..4e17f13648e 100644
@@ -8,7 +8,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "tree.h"
 #include "commit.h"
builtin/merge-tree.c +1 -1
index aa8040c2a6a..23d7e98db0d 100644
@@ -9,7 +9,7 @@
 #include "commit-reach.h"
 #include "merge-ort.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "parse-options.h"
 #include "repository.h"
 #include "blob.h"
builtin/mktag.c +2 -1
index 44fa56eff38..43e2766db49 100644
@@ -2,10 +2,11 @@
 #include "gettext.h"
 #include "hex.h"
 #include "parse-options.h"
+#include "strbuf.h"
 #include "tag.h"
 #include "replace-object.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "fsck.h"
 #include "config.h"
 
builtin/mktree.c +2 -1
index 09a7bd5c5c2..0eea810c7ea 100644
@@ -8,9 +8,10 @@
 #include "gettext.h"
 #include "hex.h"
 #include "quote.h"
+#include "strbuf.h"
 #include "tree.h"
 #include "parse-options.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static struct treeent {
 	unsigned mode;
builtin/multi-pack-index.c +2 -1
index 5bb71bce08d..a31dde1db9e 100644
@@ -5,8 +5,9 @@
 #include "gettext.h"
 #include "parse-options.h"
 #include "midx.h"
+#include "strbuf.h"
 #include "trace2.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 #define BUILTIN_MIDX_WRITE_USAGE \
 	N_("git multi-pack-index [<options>] write [--preferred-pack=<pack>]" \
builtin/notes.c +1 -1
index 0a870d90836..0a19796f734 100644
@@ -14,7 +14,7 @@
 #include "hex.h"
 #include "notes.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "repository.h"
 #include "blob.h"
builtin/pack-objects.c +1 -1
index a5b466839ba..aa595f6a4a4 100644
@@ -34,7 +34,7 @@
 #include "list.h"
 #include "packfile.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "dir.h"
 #include "midx.h"
builtin/pack-redundant.c +1 -1
index 43e9d12dfdc..4c735ba069c 100644
@@ -11,7 +11,7 @@
 #include "hex.h"
 #include "repository.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 #define BLKSIZE 512
 
builtin/prune.c +2 -1
index a46c5aa2b5b..cfb863ae848 100644
@@ -1,6 +1,7 @@
 #include "builtin.h"
 #include "commit.h"
 #include "diff.h"
+#include "dir.h"
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
@@ -13,7 +14,7 @@
 #include "replace-object.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "shallow.h"
 
 static const char * const prune_usage[] = {
builtin/receive-pack.c +1 -1
index d1718a3ac90..91caaf87066 100644
@@ -30,7 +30,7 @@
 #include "oidset.h"
 #include "packfile.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "protocol.h"
 #include "commit-reach.h"
builtin/remote.c +1 -1
index 3794f13330d..7d96687ec74 100644
@@ -11,7 +11,7 @@
 #include "rebase.h"
 #include "refs.h"
 #include "refspec.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "strvec.h"
 #include "commit-reach.h"
 #include "progress.h"
builtin/repack.c +1 -1
index fe8d5810d48..6c896c9c805 100644
@@ -16,7 +16,7 @@
 #include "midx.h"
 #include "packfile.h"
 #include "prune-packed.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "promisor-remote.h"
 #include "shallow.h"
 #include "pack.h"
builtin/replace.c +1 -1
index a2f57a56b3e..20c67a58890 100644
@@ -20,7 +20,7 @@
 #include "run-command.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "repository.h"
 #include "tag.h"
builtin/rev-list.c +1 -1
index 8029f3de53c..ff715d6918f 100644
@@ -12,7 +12,7 @@
 #include "object.h"
 #include "object-name.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pack.h"
 #include "pack-bitmap.h"
 #include "log-tree.h"
builtin/show-ref.c +1 -1
index e07e9ca862f..5110814f796 100644
@@ -4,7 +4,7 @@
 #include "hex.h"
 #include "refs.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "tag.h"
 #include "string-list.h"
builtin/submodule--helper.c +1 -1
index 6acba4ebb30..baf6ff88c3c 100644
@@ -29,7 +29,7 @@
 #include "diff.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "advice.h"
 #include "branch.h"
 #include "list-objects-filter-options.h"
builtin/tag.c +1 -1
index 87963d2cc0e..076f832802c 100644
@@ -15,7 +15,7 @@
 #include "hex.h"
 #include "refs.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "tag.h"
 #include "run-command.h"
builtin/unpack-file.c +1 -1
index b35a4b9dfee..6842a6c4996 100644
@@ -2,7 +2,7 @@
 #include "config.h"
 #include "hex.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "wrapper.h"
 
 static char *create_temp_file(struct object_id *oid)
builtin/unpack-objects.c +1 -1
index 85baf6a131a..b4b46ae7291 100644
@@ -5,7 +5,7 @@
 #include "gettext.h"
 #include "git-zlib.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "delta.h"
 #include "pack.h"
builtin/verify-commit.c +1 -1
index aa34fb896ac..9680b587013 100644
@@ -9,7 +9,7 @@
 #include "config.h"
 #include "gettext.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "commit.h"
 #include "run-command.h"
bulk-checkin.c +1 -1
index d843279715c..e2f71db0f60 100644
@@ -16,7 +16,7 @@
 #include "tmp-objdir.h"
 #include "packfile.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "wrapper.h"
 
 static int odb_transaction_nesting;
bundle-uri.c +1 -1
index 1b62902f014..a70c8887fd1 100644
@@ -4,7 +4,7 @@
 #include "copy.h"
 #include "environment.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "refs.h"
 #include "run-command.h"
 #include "hashmap.h"
bundle.c +1 -1
index a5505368de5..8d5936c4212 100644
@@ -4,7 +4,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "object.h"
 #include "commit.h"
cache-tree.c +1 -1
index 077932c2db5..84d7491420e 100644
@@ -8,7 +8,7 @@
 #include "cache-tree.h"
 #include "bulk-checkin.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "read-cache-ll.h"
 #include "replace-object.h"
 #include "promisor-remote.h"
combine-diff.c +1 -1
index 1e3cd7fb170..11e9d7494a1 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "convert.h"
 #include "blob.h"
commit-graph.c +1 -1
index 25cbd66c33a..9e989f43491 100644
@@ -12,7 +12,7 @@
 #include "hash-lookup.h"
 #include "commit-graph.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oid-array.h"
 #include "path.h"
 #include "alloc.h"
commit-graph.h +1 -1
index 83aaa1dbb92..5e534f0fcc8 100644
@@ -1,7 +1,7 @@
 #ifndef COMMIT_GRAPH_H
 #define COMMIT_GRAPH_H
 
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oidset.h"
 
 #define GIT_TEST_COMMIT_GRAPH "GIT_TEST_COMMIT_GRAPH"
commit.c +1 -1
index 10676165a1d..8dfc298d6e6 100644
@@ -7,7 +7,7 @@
 #include "hex.h"
 #include "repository.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pkt-line.h"
 #include "utf8.h"
 #include "diff.h"
config.c +1 -1
index 0b2a9f1bd89..e08e2332a68 100644
@@ -25,7 +25,7 @@
 #include "hashmap.h"
 #include "string-list.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pager.h"
 #include "path.h"
 #include "utf8.h"
connected.c +1 -1
index d672521da41..8f89376dbcf 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "run-command.h"
 #include "sigchain.h"
 #include "connected.h"
convert.c +1 -1
index 1f2cfc5f457..0010828386f 100644
@@ -5,7 +5,7 @@
 #include "copy.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "attr.h"
 #include "run-command.h"
 #include "quote.h"
diagnose.c +1 -1
index c8c7ebcfa39..8430064000b 100644
@@ -7,7 +7,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "strvec.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 #include "parse-options.h"
 #include "write-or-die.h"
diff.c +1 -1
index 9d6b88ece90..36451b444b8 100644
@@ -20,7 +20,7 @@
 #include "attr.h"
 #include "run-command.h"
 #include "utf8.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "userdiff.h"
 #include "submodule-config.h"
 #include "submodule.h"
diffcore-rename.c +1 -1
index 8e2e7a3ad73..926b554bd59 100644
@@ -6,7 +6,7 @@
 #include "alloc.h"
 #include "diff.h"
 #include "diffcore.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "hashmap.h"
 #include "mem-pool.h"
 #include "oid-array.h"
dir.c +1 -1
index 3cf3d428c7b..fada2713b9e 100644
@@ -15,7 +15,7 @@
 #include "gettext.h"
 #include "name-hash.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "attr.h"
 #include "refs.h"
entry.c +1 -1
index 041f5cf212d..f9a7c726a4d 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "blob.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "dir.h"
 #include "environment.h"
 #include "gettext.h"
environment.c +1 -1
index 56e8742ea66..5e9b331279f 100644
@@ -20,7 +20,7 @@
 #include "commit.h"
 #include "strvec.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "replace-object.h"
 #include "tmp-objdir.h"
fetch-pack.c +1 -1
index 207548b3e5a..a432eacab99 100644
@@ -24,7 +24,7 @@
 #include "oid-array.h"
 #include "oidset.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "connected.h"
 #include "fetch-negotiator.h"
fmt-merge-msg.c +1 -1
index f096b1ef549..4da6c7a8bda 100644
@@ -4,7 +4,7 @@
 #include "environment.h"
 #include "refs.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "diff.h"
 #include "diff-merges.h"
 #include "hex.h"
fsck.c +2 -1
index 04e729953b2..a219d6f2c0a 100644
@@ -1,8 +1,9 @@
 #include "git-compat-util.h"
 #include "alloc.h"
 #include "date.h"
+#include "dir.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "repository.h"
 #include "object.h"
grep.c +1 -1
index f00986c451a..ebcd6474788 100644
@@ -3,7 +3,7 @@
 #include "gettext.h"
 #include "grep.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pretty.h"
 #include "userdiff.h"
 #include "xdiff-interface.h"
http-backend.c +1 -1
index ddb9549ecbc..e1969c05dc6 100644
@@ -16,7 +16,7 @@
 #include "url.h"
 #include "strvec.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "protocol.h"
 #include "date.h"
 #include "wrapper.h"
http-push.c +1 -1
index 29cf9db34e3..9ab2383d2b4 100644
@@ -18,7 +18,7 @@
 #include "tree.h"
 #include "tree-walk.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit-reach.h"
 
 #ifdef EXPAT_NEEDS_XMLPARSE_H
http-walker.c +1 -1
index bba306b2d5e..78d99f7c4b0 100644
@@ -7,7 +7,7 @@
 #include "list.h"
 #include "transport.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 struct alt_base {
 	char *base;
http.c +1 -1
index bb58bb3e6a3..25e4c8a1ae9 100644
@@ -18,7 +18,7 @@
 #include "protocol.h"
 #include "string-list.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static struct trace_key trace_curl = TRACE_KEY_INIT(CURL);
 static int trace_curl_data = 1;
list-objects-filter.c +1 -1
index 5d270ce5987..e075a66c99d 100644
@@ -16,7 +16,7 @@
 #include "oidmap.h"
 #include "oidset.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 /* Remember to update object flag allocation in object.h */
 /*
list-objects.c +1 -1
index eecca721ac0..672a4cd5298 100644
@@ -12,7 +12,7 @@
 #include "list-objects-filter.h"
 #include "list-objects-filter-options.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "trace.h"
 
 struct traversal_context {
log-tree.c +1 -1
index 60b61597c42..f807e286c88 100644
@@ -5,7 +5,7 @@
 #include "environment.h"
 #include "hex.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "repository.h"
 #include "tmp-objdir.h"
 #include "commit.h"
mailmap.c +1 -1
index 5dc5223c430..3d6a5e9400f 100644
@@ -3,7 +3,7 @@
 #include "string-list.h"
 #include "mailmap.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "setup.h"
 
 const char *git_mailmap_file;
match-trees.c +2 -1
index 6bc8eb76477..0885ac681cd 100644
@@ -1,9 +1,10 @@
 #include "git-compat-util.h"
 #include "hex.h"
 #include "match-trees.h"
+#include "strbuf.h"
 #include "tree.h"
 #include "tree-walk.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static int score_missing(unsigned mode)
 {
merge-blobs.c +1 -1
index 40c48e3eba6..9293cbf75c8 100644
@@ -4,7 +4,7 @@
 #include "merge-ll.h"
 #include "blob.h"
 #include "merge-blobs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 static int fill_mmfile_blob(mmfile_t *f, struct blob *obj)
 {
merge-ort.c +1 -1
index f4522951323..63786c81ece 100644
@@ -34,7 +34,7 @@
 #include "match-trees.h"
 #include "mem-pool.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oid-array.h"
 #include "path.h"
 #include "promisor-remote.h"
merge-recursive.c +1 -1
index 35e1e7e1bef..43f6b2d0364 100644
@@ -26,7 +26,7 @@
 #include "name-hash.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "repository.h"
 #include "revision.h"
midx.c +1 -1
index b500174d1f3..db459e448b7 100644
@@ -9,7 +9,7 @@
 #include "lockfile.h"
 #include "packfile.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "hash-lookup.h"
 #include "midx.h"
 #include "progress.h"
notes-cache.c +2 -1
index 14288caf98f..0e1d5b1ac7a 100644
@@ -1,10 +1,11 @@
 #include "git-compat-util.h"
 #include "notes-cache.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pretty.h"
 #include "repository.h"
 #include "commit.h"
 #include "refs.h"
+#include "strbuf.h"
 
 static int notes_cache_match_validity(struct repository *r,
 				      const char *ref,
notes-merge.c +1 -1
index 4be11a01550..071947894ed 100644
@@ -5,7 +5,7 @@
 #include "refs.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "repository.h"
 #include "diff.h"
notes.c +1 -1
index 02f1aa39ae1..4d2836a7c76 100644
@@ -4,7 +4,7 @@
 #include "hex.h"
 #include "notes.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "tree.h"
 #include "utf8.h"
object-name.c +1 -1
index 45f4d51305b..7e96c97051e 100644
@@ -17,7 +17,7 @@
 #include "oidtree.h"
 #include "packfile.h"
 #include "pretty.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "read-cache-ll.h"
 #include "repository.h"
 #include "setup.h"
object-store-ll.h new file +533 -0

533 lines not on this page · raw message

object-store.h +1 -527

538 lines not on this page · raw message

oss-fuzz/fuzz-pack-idx.c +1 -1
index 609a343ee3e..3e190214d14 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
pack-bitmap-write.c +1 -1
index 623ee2a8197..d86f4e739a4 100644
@@ -3,7 +3,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "tag.h"
 #include "diff.h"
pack-bitmap.c +1 -1
index e0fad723bf3..3981655f3cf 100644
@@ -17,7 +17,7 @@
 #include "repository.h"
 #include "trace2.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "list-objects-filter-options.h"
 #include "midx.h"
 #include "config.h"
pack-check.c +1 -1
index 049f2f0bfc0..977f619618e 100644
@@ -7,7 +7,7 @@
 #include "progress.h"
 #include "packfile.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 struct idx_entry {
 	off_t                offset;
pack-mtimes.c +2 -1
index 020a37f8fe3..cdf30b8d2b0 100644
@@ -2,8 +2,9 @@
 #include "gettext.h"
 #include "pack-mtimes.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
+#include "strbuf.h"
 
 static char *pack_mtimes_filename(struct packed_git *p)
 {
pack-objects.h +1 -1
index 579476687c4..0d78db40cb2 100644
@@ -1,7 +1,7 @@
 #ifndef PACK_OBJECTS_H
 #define PACK_OBJECTS_H
 
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "thread-utils.h"
 #include "pack.h"
 
pack-revindex.c +2 -1
index 1f51b712e87..7fffcad9125 100644
@@ -2,8 +2,9 @@
 #include "gettext.h"
 #include "pack-revindex.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
+#include "strbuf.h"
 #include "trace2.h"
 #include "config.h"
 #include "midx.h"
pack-write.c +1 -0
index 45681e2d7db..af48813a9bb 100644
@@ -11,6 +11,7 @@
 #include "pack-objects.h"
 #include "pack-revindex.h"
 #include "path.h"
+#include "strbuf.h"
 #include "wrapper.h"
 
 void reset_pack_idx_option(struct pack_idx_option *opts)
packfile.c +1 -1
index fd083c86e00..c60aeb05ece 100644
@@ -19,7 +19,7 @@
 #include "tree-walk.h"
 #include "tree.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "midx.h"
 #include "commit-graph.h"
 #include "pack-revindex.h"
path.c +1 -1
index 7c1cd8182a8..c3b6618c77b 100644
@@ -15,7 +15,7 @@
 #include "submodule-config.h"
 #include "path.h"
 #include "packfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "lockfile.h"
 #include "exec-cmd.h"
 #include "wrapper.h"
promisor-remote.c +1 -1
index 1adcd6fb0a5..db88d2064d4 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "gettext.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "promisor-remote.h"
 #include "config.h"
 #include "trace2.h"
protocol-caps.c +1 -1
index a90c48852e5..808a68c974a 100644
@@ -7,7 +7,7 @@
 #include "hash-ll.h"
 #include "hex.h"
 #include "object.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "string-list.h"
 #include "strbuf.h"
 
prune-packed.c +1 -1
index 58412b4fb91..e54daf740a2 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "environment.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 #include "progress.h"
 #include "prune-packed.h"
reachable.c +1 -1
index 55bb1143530..434f09e9ebf 100644
@@ -13,7 +13,7 @@
 #include "list-objects.h"
 #include "packfile.h"
 #include "worktree.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pack-bitmap.h"
 #include "pack-mtimes.h"
 
read-cache.c +1 -1
index 86ada403a83..b9a995e5a18 100644
@@ -17,7 +17,7 @@
 #include "refs.h"
 #include "dir.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oid-array.h"
 #include "tree.h"
 #include "commit.h"
ref-filter.c +1 -1
index 4991cd4f7a8..e0d03a9f8e9 100644
@@ -8,7 +8,7 @@
 #include "refs.h"
 #include "wildmatch.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oid-array.h"
 #include "repository.h"
 #include "commit.h"
reflog.c +1 -1
index ee1bf5d032c..9ad50e7d93e 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "gettext.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "reflog.h"
 #include "refs.h"
 #include "revision.h"
refs.c +1 -1
index 5f76da35673..54a827b45b3 100644
@@ -17,7 +17,7 @@
 #include "run-command.h"
 #include "hook.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "path.h"
 #include "tag.h"
remote.c +1 -1
index 8550056db43..6538b6037de 100644
@@ -10,7 +10,7 @@
 #include "refs.h"
 #include "refspec.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "commit.h"
 #include "diff.h"
replace-object.c +1 -1
index e98825d5852..ca4017635df 100644
@@ -2,7 +2,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "oidmap.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "refs.h"
 #include "repository.h"
replace-object.h +1 -1
index 500482b02b3..a964db1670e 100644
@@ -3,7 +3,7 @@
 
 #include "oidmap.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 /*
  * Do replace refs need to be checked this run?  This variable is
repository.c +1 -1
index 87a7a27b665..8c77b7ed236 100644
@@ -6,7 +6,7 @@
 #include "git-compat-util.h"
 #include "abspath.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "config.h"
 #include "object.h"
 #include "lockfile.h"
rerere.c +1 -1
index 3584fecb07c..e2b8597f88c 100644
@@ -17,7 +17,7 @@
 #include "path.h"
 #include "pathspec.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "hash-lookup.h"
 #include "strmap.h"
 #include "wrapper.h"
revision.c +1 -1
index d4b4b34fd80..84768565cef 100644
@@ -6,7 +6,7 @@
 #include "hex.h"
 #include "object-name.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "tag.h"
 #include "blob.h"
 #include "tree.h"
send-pack.c +1 -1
index 0c7ccaef680..9510bef8561 100644
@@ -5,7 +5,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "refs.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pkt-line.h"
 #include "sideband.h"
 #include "run-command.h"
sequencer.c +1 -1
index eddd38d4bed..1b9607da268 100644
@@ -11,7 +11,7 @@
 #include "dir.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "pager.h"
 #include "commit.h"
server-info.c +1 -1
index 85d17bbb151..382e481a2b0 100644
@@ -11,7 +11,7 @@
 #include "packfile.h"
 #include "path.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "server-info.h"
 #include "strbuf.h"
 #include "wrapper.h"
shallow.c +1 -1
index 45343e6a78b..f3ef94d4c92 100644
@@ -4,7 +4,7 @@
 #include "repository.h"
 #include "tempfile.h"
 #include "lockfile.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "tag.h"
 #include "pkt-line.h"
streaming.c +1 -1
index 21e39585e89..49791ab958d 100644
@@ -7,7 +7,7 @@
 #include "streaming.h"
 #include "repository.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "replace-object.h"
 #include "packfile.h"
 #include "wrapper.h"
submodule-config.c +1 -1
index c67260a3e11..1efd5471698 100644
@@ -11,7 +11,7 @@
 #include "submodule.h"
 #include "strbuf.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "parse-options.h"
 #include "thread-utils.h"
 #include "tree-walk.h"
submodule.c +1 -1
index 245300596ff..f0f8788d2e3 100644
@@ -27,7 +27,7 @@
 #include "parse-options.h"
 #include "object-file.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit-reach.h"
 #include "read-cache-ll.h"
 #include "setup.h"
t/helper/test-pack-mtimes.c +1 -1
index 0f3fbeec532..67a964ef904 100644
@@ -1,7 +1,7 @@
 #include "test-tool.h"
 #include "hex.h"
 #include "strbuf.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "packfile.h"
 #include "pack-mtimes.h"
 #include "setup.h"
t/helper/test-partial-clone.c +1 -1
index 362bd64a4c2..910a1286144 100644
@@ -1,7 +1,7 @@
 #include "test-tool.h"
 #include "hex.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "setup.h"
 
 /*
t/helper/test-read-graph.c +1 -1
index 3ac496e27e4..8c7a83f578f 100644
@@ -1,7 +1,7 @@
 #include "test-tool.h"
 #include "commit-graph.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "bloom.h"
 #include "setup.h"
 
t/helper/test-read-midx.c +1 -1
index 211addaa005..e9a444ddba5 100644
@@ -2,7 +2,7 @@
 #include "hex.h"
 #include "midx.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "pack-bitmap.h"
 #include "packfile.h"
 #include "setup.h"
t/helper/test-ref-store.c +2 -1
index 1b30a6cba8b..04d26fc2fef 100644
@@ -3,9 +3,10 @@
 #include "refs.h"
 #include "setup.h"
 #include "worktree.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "path.h"
 #include "repository.h"
+#include "strbuf.h"
 
 struct flag_definition {
 	const char *name;
t/helper/test-repository.c +1 -1
index bafd2a5bf95..4cd8a952e5c 100644
@@ -4,7 +4,7 @@
 #include "config.h"
 #include "environment.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "object.h"
 #include "repository.h"
 #include "setup.h"
tag.c +1 -1
index 96dbd5b2d55..c5426484b22 100644
@@ -2,7 +2,7 @@
 #include "environment.h"
 #include "tag.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
 #include "tree.h"
 #include "blob.h"
tmp-objdir.c +1 -1
index db1f7038dae..5f9074ad1c0 100644
@@ -11,7 +11,7 @@
 #include "strbuf.h"
 #include "strvec.h"
 #include "quote.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 
 struct tmp_objdir {
 	struct strbuf path;
transport.c +1 -1
index 67afdae57c1..4dc187a3885 100644
@@ -27,7 +27,7 @@
 #include "transport-internal.h"
 #include "protocol.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "color.h"
 #include "bundle-uri.h"
 #include "wrapper.h"
tree-walk.c +1 -1
index d3c48e06df0..42ed86ef581 100644
@@ -5,7 +5,7 @@
 #include "gettext.h"
 #include "hex.h"
 #include "object-file.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "trace2.h"
 #include "tree.h"
 #include "pathspec.h"
tree.c +1 -1
index 0dd2029a8a2..e118914a76a 100644
@@ -3,7 +3,7 @@
 #include "hex.h"
 #include "tree.h"
 #include "object-name.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "blob.h"
 #include "commit.h"
 #include "tag.h"
unpack-trees.c +1 -1
index 4b620df3031..87517364dc0 100644
@@ -23,7 +23,7 @@
 #include "symlinks.h"
 #include "trace2.h"
 #include "fsmonitor.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "promisor-remote.h"
 #include "entry.h"
 #include "parallel-checkout.h"
upload-pack.c +1 -1
index 08633dc1216..2502dcb4699 100644
@@ -7,7 +7,7 @@
 #include "pkt-line.h"
 #include "sideband.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "oid-array.h"
 #include "tag.h"
 #include "object.h"
walker.c +2 -1
index 24ff7dfdc28..65002a7220a 100644
@@ -3,8 +3,9 @@
 #include "hex.h"
 #include "walker.h"
 #include "repository.h"
-#include "object-store.h"
+#include "object-store-ll.h"
 #include "commit.h"
+#include "strbuf.h"
 #include "tree.h"
 #include "tree-walk.h"
 #include "tag.h"
xdiff-interface.c +2 -1
index 0460e03f5ed..abc7275a528 100644
@@ -1,7 +1,8 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "hex.h"
-#include "object-store.h"
+#include "object-store-ll.h"
+#include "strbuf.h"
 #include "xdiff-interface.h"
 #include "xdiff/xtypes.h"
 #include "xdiff/xdiffi.h"
Signature · 1 line
gitgitgadget
#111 lore raw

PATCH v3 27/28 hash-ll, hashmap: move oidhash() to hash-ll

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

oidhash() was used by both hashmap and khash, which makes sense. However, the location of this function in hashmap.[ch] meant that khash.h had to depend upon hashmap.h, making people unfamiliar with khash think that it was built upon hashmap. (Or at least, I personally was confused for a while about this in the past.)

Move this function to hash-ll, so that khash.h can stop depending upon hashmap.h.

This has another benefit as well: it allows us to remove hashmap.h's dependency on hash-ll.h. While some callers of hashmap.h were making use of oidhash, most were not, so this change provides another way to reduce the number of includes.

Diff best viewed with --color-moved.

---
 decorate.c |  1 -
 dir.h      |  1 +
 hash-ll.h  | 19 +++++++++++++++++++
 hashmap.h  | 21 ---------------------
 khash.h    |  1 -
 remote.h   |  1 +
 serve.c    |  1 +
 7 files changed, 22 insertions(+), 23 deletions(-)
decorate.c +0 -1
index 71e79daa825..a5c43c0c146 100644
@@ -3,7 +3,6 @@
  * data.
  */
 #include "git-compat-util.h"
-#include "hashmap.h"
 #include "object.h"
 #include "decorate.h"
 
dir.h +1 -0
index 79b85a01ee4..279a0660801 100644
@@ -1,6 +1,7 @@
 #ifndef DIR_H
 #define DIR_H
 
+#include "hash-ll.h"
 #include "hashmap.h"
 #include "pathspec.h"
 #include "statinfo.h"
hash-ll.h +19 -0
index 80509251370..8d7973769fd 100644
@@ -270,6 +270,25 @@ static inline void oid_set_algo(struct object_id *oid, const struct git_hash_alg
 	oid->algo = hash_algo_by_ptr(algop);
 }
 
+/*
+ * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
+ * for use in hash tables. Cryptographic hashes are supposed to have
+ * uniform distribution, so in contrast to `memhash()`, this just copies
+ * the first `sizeof(int)` bytes without shuffling any bits. Note that
+ * the results will be different on big-endian and little-endian
+ * platforms, so they should not be stored or transferred over the net.
+ */
+static inline unsigned int oidhash(const struct object_id *oid)
+{
+	/*
+	 * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on
+	 * platforms that don't support unaligned reads.
+	 */
+	unsigned int hash;
+	memcpy(&hash, oid->hash, sizeof(hash));
+	return hash;
+}
+
 const char *empty_tree_oid_hex(void);
 const char *empty_blob_oid_hex(void);
 
hashmap.h +0 -21
index 2695f3d3a6e..c8216e47bb2 100644
@@ -1,8 +1,6 @@
 #ifndef HASHMAP_H
 #define HASHMAP_H
 
-#include "hash-ll.h"
-
 /*
  * Generic implementation of hash-based key-value mappings.
  *
@@ -120,25 +118,6 @@ unsigned int memhash(const void *buf, size_t len);
 unsigned int memihash(const void *buf, size_t len);
 unsigned int memihash_cont(unsigned int hash_seed, const void *buf, size_t len);
 
-/*
- * Converts a cryptographic hash (e.g. SHA-1) into an int-sized hash code
- * for use in hash tables. Cryptographic hashes are supposed to have
- * uniform distribution, so in contrast to `memhash()`, this just copies
- * the first `sizeof(int)` bytes without shuffling any bits. Note that
- * the results will be different on big-endian and little-endian
- * platforms, so they should not be stored or transferred over the net.
- */
-static inline unsigned int oidhash(const struct object_id *oid)
-{
-	/*
-	 * Equivalent to 'return *(unsigned int *)oid->hash;', but safe on
-	 * platforms that don't support unaligned reads.
-	 */
-	unsigned int hash;
-	memcpy(&hash, oid->hash, sizeof(hash));
-	return hash;
-}
-
 /*
  * struct hashmap_entry is an opaque structure representing an entry in the
  * hash table.
khash.h +0 -1
index a0a08dad8b7..ff881631778 100644
@@ -26,7 +26,6 @@
 #ifndef __AC_KHASH_H
 #define __AC_KHASH_H
 
-#include "hashmap.h"
 #include "hash.h"
 
 #define AC_VERSION_KHASH_H "0.2.8"
remote.h +1 -0
index 73638cefeb1..929c7c676d3 100644
@@ -1,6 +1,7 @@
 #ifndef REMOTE_H
 #define REMOTE_H
 
+#include "hash-ll.h"
 #include "hashmap.h"
 #include "refspec.h"
 
serve.c +1 -0
index 5329c91011f..a1d71134d49 100644
@@ -1,6 +1,7 @@
 #include "git-compat-util.h"
 #include "repository.h"
 #include "config.h"
+#include "hash-ll.h"
 #include "pkt-line.h"
 #include "version.h"
 #include "ls-refs.h"
Signature · 1 line
gitgitgadget
#112 lore raw

PATCH v3 28/28 fsmonitor-ll.h: split this header out of fsmonitor.h

In reply to Elijah Newren via GitGitGadget

From: Elijah Newren <[email protected]>

This creates a new fsmonitor-ll.h with most of the functions from fsmonitor.h, though it leaves three inline functions where they were. Two-thirds of the files that previously included fsmonitor.h did not need those three inline functions or the six extra includes those inline functions required, so this allows them to only include the lower level header.

Diff best viewed with --color-moved.

---
 builtin/fsmonitor--daemon.c              |  4 +-
 compat/fsmonitor/fsm-health-darwin.c     |  2 +-
 compat/fsmonitor/fsm-health-win32.c      |  2 +-
 compat/fsmonitor/fsm-ipc-darwin.c        |  2 +-
 compat/fsmonitor/fsm-listen-darwin.c     |  3 +-
 compat/fsmonitor/fsm-listen-win32.c      |  2 +-
 compat/fsmonitor/fsm-path-utils-darwin.c |  3 +-
 compat/fsmonitor/fsm-path-utils-win32.c  |  3 +-
 compat/fsmonitor/fsm-settings-darwin.c   |  2 +-
 compat/fsmonitor/fsm-settings-win32.c    |  2 +-
 dir.c                                    |  3 +-
 fsmonitor-ipc.c                          |  2 +-
 fsmonitor-ll.h                           | 52 ++++++++++++++++++++++++
 fsmonitor.h                              | 46 +--------------------
 sparse-index.c                           |  3 +-
 15 files changed, 73 insertions(+), 58 deletions(-)
 create mode 100644 fsmonitor-ll.h
builtin/fsmonitor--daemon.c +3 -1
index f6dd9a784c1..74d1d6a585d 100644
@@ -5,15 +5,17 @@
 #include "environment.h"
 #include "gettext.h"
 #include "parse-options.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-ipc.h"
 #include "fsmonitor-path-utils.h"
+#include "fsmonitor-settings.h"
 #include "compat/fsmonitor/fsm-health.h"
 #include "compat/fsmonitor/fsm-listen.h"
 #include "fsmonitor--daemon.h"
 #include "simple-ipc.h"
 #include "khash.h"
 #include "pkt-line.h"
+#include "trace.h"
 #include "trace2.h"
 
 static const char * const builtin_fsmonitor__daemon_usage[] = {
compat/fsmonitor/fsm-health-darwin.c +1 -1
index 4c291f8a066..5b1709d63f7 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsm-health.h"
 #include "fsmonitor--daemon.h"
 
compat/fsmonitor/fsm-health-win32.c +1 -1
index 6c81d7ee5c2..2d4e245beb1 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsm-health.h"
 #include "fsmonitor--daemon.h"
 #include "gettext.h"
compat/fsmonitor/fsm-ipc-darwin.c +1 -1
index 964bc074db6..6f3a95410cc 100644
@@ -5,7 +5,7 @@
 #include "path.h"
 #include "repository.h"
 #include "strbuf.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-ipc.h"
 #include "fsmonitor-path-utils.h"
 
compat/fsmonitor/fsm-listen-darwin.c +2 -1
index 23e24b4b374..36c7e13281c 100644
@@ -24,12 +24,13 @@
 #endif
 
 #include "git-compat-util.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsm-listen.h"
 #include "fsmonitor--daemon.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
 #include "string-list.h"
+#include "trace.h"
 
 struct fsm_listen_data
 {
compat/fsmonitor/fsm-listen-win32.c +1 -1
index 3c0df5cff8c..a361a7db20e 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsm-listen.h"
 #include "fsmonitor--daemon.h"
 #include "gettext.h"
compat/fsmonitor/fsm-path-utils-darwin.c +2 -1
index ef0142e0fbf..049f97eaaf2 100644
@@ -1,7 +1,8 @@
 #include "git-compat-util.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
+#include "trace.h"
 #include <dirent.h>
 #include <errno.h>
 #include <fcntl.h>
compat/fsmonitor/fsm-path-utils-win32.c +2 -1
index 27bb6945183..c8a3e9dcdbb 100644
@@ -1,7 +1,8 @@
 #include "git-compat-util.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-path-utils.h"
 #include "gettext.h"
+#include "trace.h"
 
 /*
  * Check remote working directory protocol.
compat/fsmonitor/fsm-settings-darwin.c +1 -1
index 58b623fbb9a..a3825906351 100644
@@ -1,6 +1,6 @@
 #include "git-compat-util.h"
 #include "config.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-ipc.h"
 #include "fsmonitor-settings.h"
 #include "fsmonitor-path-utils.h"
compat/fsmonitor/fsm-settings-win32.c +1 -1
index 37288978643..b6f67444944 100644
@@ -1,7 +1,7 @@
 #include "git-compat-util.h"
 #include "config.h"
 #include "repository.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "fsmonitor-settings.h"
 #include "fsmonitor-path-utils.h"
 
dir.c +2 -1
index fada2713b9e..3acac7beb11 100644
@@ -24,7 +24,8 @@
 #include "utf8.h"
 #include "varint.h"
 #include "ewah/ewok.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
+#include "read-cache-ll.h"
 #include "setup.h"
 #include "sparse-index.h"
 #include "submodule-config.h"
fsmonitor-ipc.c +1 -1
index 6ace978a1b4..88575aa54ca 100644
@@ -1,5 +1,5 @@
 #include "git-compat-util.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 #include "gettext.h"
 #include "simple-ipc.h"
 #include "fsmonitor-ipc.h"
fsmonitor-ll.h new file +52 -0

52 lines not on this page · raw message

fsmonitor.h +1 -45

58 lines not on this page · raw message

sparse-index.c +2 -1
index 2c47954d933..90d04622568 100644
@@ -3,6 +3,7 @@
 #include "environment.h"
 #include "gettext.h"
 #include "name-hash.h"
+#include "read-cache-ll.h"
 #include "repository.h"
 #include "sparse-index.h"
 #include "tree.h"
@@ -11,7 +12,7 @@
 #include "cache-tree.h"
 #include "config.h"
 #include "dir.h"
-#include "fsmonitor.h"
+#include "fsmonitor-ll.h"
 
 struct modify_index_context {
 	struct index_state *write;
Signature · 1 line
gitgitgadget
#113 lore raw
In reply to Elijah Newren via GitGitGadget
Quoted 3 lines · Elijah Newren via GitGitGadget

* a textual & semantic conflict with cw/strbuf-cleanup (affecting strbuf.c; to address, delete the conflict region and also delete the include of repository.h)

In patch 19, you also include path.h into strbuf.c because before my series, strbuf.c had a dependency on repository.h. Since that dependency is removed, there is no need to include path.h anymore.

#114 lore raw
Quoted 10 lines · Calvin Wan
Quoted 3 lines · Elijah Newren via GitGitGadget

* a textual & semantic conflict with cw/strbuf-cleanup (affecting strbuf.c; to address, delete the conflict region and also delete the include of repository.h)

In patch 19, you also include path.h into strbuf.c because before my series, strbuf.c had a dependency on repository.h. Since that dependency is removed, there is no need to include path.h anymore.

The path.h include is shown within the conflict markers, thus removing it was already part of my instructions ("delete the conflict region...").

It looks like Junio merged your series to seen first, as I was assuming in my instructions, so this suggests there was an error of some sort when he merged my series:

$ git show --oneline --remerge-diff
862248e47048c9282bc00ac6d9dcc7a21bd11ab1 -- strbuf.c
862248e4704 (gitster/jch, gitgitgadget/jch) Merge branch
'en/header-split-cache-h-part-3' into jch
strbuf.c +0 -0

remerge CONFLICT (content): Merge conflict in strbuf.c index dfaf41d2f18..37fd5247b32 100644

strbuf.c +0 -9
@@ -2,16 +2,7 @@
 #include "alloc.h"
 #include "gettext.h"
 #include "hex.h"
-<<<<<<< d1af2a2c773 (Merge branch 'la/doc-interpret-trailers' into jch)
-||||||| merged common ancestors
-#include "object-name.h"
-#include "refs.h"
-=======
-#include "object-name.h"
-#include "refs.h"
 #include "path.h"
->>>>>>> d677f7e76ab (fsmonitor-ll.h: split this header out of fsmonitor.h)
-#include "repository.h"
 #include "strbuf.h"
 #include "string-list.h"
 #include "utf8.h"

Junio: Do you want to fix/amend that merge to remove the entire conflict region (so removing the line involving path.h too)? Or are you preserving that line for some reason?

Anyway, not a real big deal; it'll still compile with the extra include. If Junio doesn't tweak the merges to clean this up, then I'll just add this into my follow-on series dealing with extra include cleanups.