Skip to content

Commit

Permalink
read-cache*.h: move declarations for read-cache.c functions from cache.h
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
newren authored and gitster committed Jun 21, 2023
1 parent bc47f16 commit 08c46a4
Show file tree
Hide file tree
Showing 77 changed files with 603 additions and 524 deletions.
1 change: 1 addition & 0 deletions add-interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions add-patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/checkout--worker.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions builtin/checkout-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions builtin/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions builtin/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/difftool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions builtin/ls-files.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/merge-index.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/pull.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/rev-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/rm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/submodule--helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/update-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions builtin/worktree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions cache-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 08c46a4

Please sign in to comment.