Skip to content

Commit

Permalink
object-store-ll.h: split this header out of object-store.h
Browse files Browse the repository at this point in the history
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`.

Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
newren authored and gitster committed Jun 21, 2023
1 parent 8043418 commit a034e91
Show file tree
Hide file tree
Showing 131 changed files with 677 additions and 655 deletions.
2 changes: 1 addition & 1 deletion apply.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion archive-tar.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion archive-zip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion bisect.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion blame.c
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/cat-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/commit-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/commit-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/count-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion builtin/describe.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/difftool.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/fast-export.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/fsck.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/grep.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion builtin/hash-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

/*
Expand Down
3 changes: 2 additions & 1 deletion builtin/index-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/log.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/ls-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/merge-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion builtin/mktag.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion builtin/mktree.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion builtin/multi-pack-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>]" \
Expand Down
2 changes: 1 addition & 1 deletion builtin/notes.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/pack-redundant.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion builtin/prune.c
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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[] = {
Expand Down
2 changes: 1 addition & 1 deletion builtin/receive-pack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/replace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/rev-list.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/show-ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion builtin/submodule--helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit a034e91

Please sign in to comment.