Skip to content

Commit a1264a0

Browse files
committed
Merge branch 'en/header-split-cache-h-part-3'
Header files cleanup. * en/header-split-cache-h-part-3: (28 commits) fsmonitor-ll.h: split this header out of fsmonitor.h hash-ll, hashmap: move oidhash() to hash-ll object-store-ll.h: split this header out of object-store.h khash: name the structs that khash declares merge-ll: rename from ll-merge git-compat-util.h: remove unneccessary include of wildmatch.h builtin.h: remove unneccessary includes list-objects-filter-options.h: remove unneccessary include diff.h: remove unnecessary include of oidset.h repository: remove unnecessary include of path.h log-tree: replace include of revision.h with simple forward declaration cache.h: remove this no-longer-used header read-cache*.h: move declarations for read-cache.c functions from cache.h repository.h: move declaration of the_index from cache.h merge.h: move declarations for merge.c from cache.h diff.h: move declaration for global in diff.c from cache.h preload-index.h: move declarations for preload-index.c from elsewhere sparse-index.h: move declarations for sparse-index.c from cache.h name-hash.h: move declarations for name-hash.c from cache.h run-command.h: move declarations for run-command.c from cache.h ...
2 parents b2166b0 + 68d6864 commit a1264a0

File tree

313 files changed

+2179
-1898
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

313 files changed

+2179
-1898
lines changed

Documentation/CodingGuidelines

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ For C programs:
448448
- The first #include in C files, except in platform specific compat/
449449
implementations and sha1dc/, must be either "git-compat-util.h" or
450450
one of the approved headers that includes it first for you. (The
451-
approved headers currently include "cache.h", "builtin.h",
451+
approved headers currently include "builtin.h",
452452
"t/helper/test-tool.h", "xdiff/xinclude.h", or
453453
"reftable/system.h"). You do not have to include more than one of
454454
these.

Documentation/MyFirstObjectWalk.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ parameters provided by the user over the CLI.
124124

125125
`nr` represents the number of `rev_cmdline_entry` present in the array.
126126

127-
`alloc` is used by the `ALLOC_GROW` macro. Check `cache.h` - this variable is
127+
`alloc` is used by the `ALLOC_GROW` macro. Check `alloc.h` - this variable is
128128
used to track the allocated size of the list.
129129

130130
Per entry, we find:

Documentation/technical/api-merge.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ and `diff.c` for examples.
2828

2929
* `struct ll_merge_options`
3030

31-
Check ll-merge.h for details.
31+
Check merge-ll.h for details.
3232

3333
Low-level (single file) merge
3434
-----------------------------
3535

36-
Check ll-merge.h for details.
36+
Check merge-ll.h for details.

Documentation/user-manual.txt

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4129,13 +4129,11 @@ Note that terminology has changed since that revision. For example, the
41294129
README in that revision uses the word "changeset" to describe what we
41304130
now call a <<def_commit_object,commit>>.
41314131

4132-
Also, we do not call it "cache" any more, but rather "index"; however, the
4133-
file is still called `cache.h`. Remark: Not much reason to change it now,
4134-
especially since there is no good single name for it anyway, because it is
4135-
basically _the_ header file which is included by _all_ of Git's C sources.
4132+
Also, we do not call it "cache" any more, but rather "index"; however,
4133+
the file is still called `read-cache.h`.
41364134

41374135
If you grasp the ideas in that initial commit, you should check out a
4138-
more recent version and skim `cache.h`, `object.h` and `commit.h`.
4136+
more recent version and skim `read-cache-ll.h`, `object.h` and `commit.h`.
41394137

41404138
In the early days, Git (in the tradition of UNIX) was a bunch of programs
41414139
which were extremely simple, and which you used in scripts, piping the
@@ -4146,11 +4144,11 @@ many of these parts have become builtins, and some of the core has been
41464144
and to avoid code duplication.
41474145

41484146
By now, you know what the index is (and find the corresponding data
4149-
structures in `cache.h`), and that there are just a couple of object types
4150-
(blobs, trees, commits and tags) which inherit their common structure from
4151-
`struct object`, which is their first member (and thus, you can cast e.g.
4152-
`(struct object *)commit` to achieve the _same_ as `&commit->object`, i.e.
4153-
get at the object name and flags).
4147+
structures in `read-cache-ll.h`), and that there are just a couple of
4148+
object types (blobs, trees, commits and tags) which inherit their
4149+
common structure from `struct object`, which is their first member
4150+
(and thus, you can cast e.g. `(struct object *)commit` to achieve the
4151+
_same_ as `&commit->object`, i.e. get at the object name and flags).
41544152

41554153
Now is a good point to take a break to let this information sink in.
41564154

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,6 @@ LIB_OBJS += linear-assignment.o
10511051
LIB_OBJS += list-objects-filter-options.o
10521052
LIB_OBJS += list-objects-filter.o
10531053
LIB_OBJS += list-objects.o
1054-
LIB_OBJS += ll-merge.o
10551054
LIB_OBJS += lockfile.o
10561055
LIB_OBJS += log-tree.o
10571056
LIB_OBJS += ls-refs.o
@@ -1060,6 +1059,7 @@ LIB_OBJS += mailmap.o
10601059
LIB_OBJS += match-trees.o
10611060
LIB_OBJS += mem-pool.o
10621061
LIB_OBJS += merge-blobs.o
1062+
LIB_OBJS += merge-ll.o
10631063
LIB_OBJS += merge-ort.o
10641064
LIB_OBJS += merge-ort-wrappers.o
10651065
LIB_OBJS += merge-recursive.o
@@ -1142,6 +1142,7 @@ LIB_OBJS += sigchain.o
11421142
LIB_OBJS += sparse-index.o
11431143
LIB_OBJS += split-index.o
11441144
LIB_OBJS += stable-qsort.o
1145+
LIB_OBJS += statinfo.o
11451146
LIB_OBJS += strbuf.o
11461147
LIB_OBJS += streaming.o
11471148
LIB_OBJS += string-list.o
@@ -1951,7 +1952,7 @@ endif
19511952
BASIC_CFLAGS += \
19521953
-DSHA1DC_NO_STANDARD_INCLUDES \
19531954
-DSHA1DC_INIT_SAFE_HASH_DEFAULT=0 \
1954-
-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"cache.h\"" \
1955+
-DSHA1DC_CUSTOM_INCLUDE_SHA1_C="\"git-compat-util.h\"" \
19551956
-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C="\"git-compat-util.h\""
19561957
endif
19571958
endif
@@ -2742,8 +2743,8 @@ exec-cmd.sp exec-cmd.s exec-cmd.o: EXTRA_CPPFLAGS = \
27422743
'-DBINDIR="$(bindir_relative_SQ)"' \
27432744
'-DFALLBACK_RUNTIME_PREFIX="$(prefix_SQ)"'
27442745

2745-
builtin/init-db.sp builtin/init-db.s builtin/init-db.o: GIT-PREFIX
2746-
builtin/init-db.sp builtin/init-db.s builtin/init-db.o: EXTRA_CPPFLAGS = \
2746+
setup.sp setup.s setup.o: GIT-PREFIX
2747+
setup.sp setup.s setup.o: EXTRA_CPPFLAGS = \
27472748
-DDEFAULT_GIT_TEMPLATE_DIR='"$(template_dir_SQ)"'
27482749

27492750
config.sp config.s config.o: GIT-PREFIX

add-interactive.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "add-interactive.h"
33
#include "color.h"
44
#include "config.h"
55
#include "diffcore.h"
66
#include "gettext.h"
7+
#include "hash.h"
78
#include "hex.h"
9+
#include "preload-index.h"
10+
#include "read-cache-ll.h"
11+
#include "repository.h"
812
#include "revision.h"
913
#include "refs.h"
1014
#include "string-list.h"

add-patch.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
#include "cache.h"
1+
#include "git-compat-util.h"
22
#include "add-interactive.h"
33
#include "advice.h"
44
#include "alloc.h"
55
#include "editor.h"
66
#include "environment.h"
77
#include "gettext.h"
88
#include "object-name.h"
9+
#include "read-cache-ll.h"
10+
#include "repository.h"
911
#include "strbuf.h"
1012
#include "run-command.h"
1113
#include "strvec.h"

apply.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
*
88
*/
99

10-
#include "cache.h"
10+
#include "git-compat-util.h"
1111
#include "abspath.h"
1212
#include "alloc.h"
1313
#include "base85.h"
1414
#include "config.h"
15-
#include "object-store.h"
15+
#include "object-store-ll.h"
1616
#include "blob.h"
1717
#include "delta.h"
1818
#include "diff.h"
@@ -21,17 +21,21 @@
2121
#include "gettext.h"
2222
#include "hex.h"
2323
#include "xdiff-interface.h"
24-
#include "ll-merge.h"
24+
#include "merge-ll.h"
2525
#include "lockfile.h"
26+
#include "name-hash.h"
2627
#include "object-name.h"
2728
#include "object-file.h"
2829
#include "parse-options.h"
30+
#include "path.h"
2931
#include "quote.h"
32+
#include "read-cache.h"
3033
#include "rerere.h"
3134
#include "apply.h"
3235
#include "entry.h"
3336
#include "setup.h"
3437
#include "symlinks.h"
38+
#include "wildmatch.h"
3539
#include "ws.h"
3640
#include "wrapper.h"
3741

archive-tar.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "hex.h"
1010
#include "tar.h"
1111
#include "archive.h"
12-
#include "object-store.h"
12+
#include "object-store-ll.h"
1313
#include "streaming.h"
1414
#include "run-command.h"
1515
#include "write-or-die.h"

archive-zip.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "hex.h"
1010
#include "streaming.h"
1111
#include "utf8.h"
12-
#include "object-store.h"
12+
#include "object-store-ll.h"
1313
#include "userdiff.h"
1414
#include "write-or-die.h"
1515
#include "xdiff-interface.h"

0 commit comments

Comments
 (0)