summaryrefslogtreecommitdiffstats
path: root/midx.h
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2024-08-06 17:36:44 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-06 21:01:36 +0200
commit2678a730093cb8c3e728cc6bc7e1da414fac7953 (patch)
tree543c68db76dda18cc7e25e7781c51b712eb8cad9 /midx.h
parentDocumentation: describe incremental MIDX format (diff)
downloadgit-2678a730093cb8c3e728cc6bc7e1da414fac7953.tar.xz
git-2678a730093cb8c3e728cc6bc7e1da414fac7953.zip
midx: add new fields for incremental MIDX chains
The incremental MIDX chain feature is designed around the idea of indexing into a concatenated lexicographic ordering of object IDs present in the MIDX. When given an object position, the MIDX machinery needs to be able to locate both (a) which MIDX layer contains the given object, and (b) at what position *within that MIDX layer* that object appears. To do this, three new fields are added to the `struct multi_pack_index`: - struct multi_pack_index *base_midx; - uint32_t num_objects_in_base; - uint32_t num_packs_in_base; These three fields store the pieces of information suggested by their respective field names. In turn, the `num_objects_in_base` and `num_packs_in_base` fields are used to crawl backwards along the `base_midx` pointer to locate the appropriate position for a given object within the MIDX that contains it. The following commits will update various parts of the MIDX machinery (as well as their callers from outside of midx.c and midx-write.c) to be aware and make use of these fields when performing object lookups. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.h')
-rw-r--r--midx.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/midx.h b/midx.h
index 8554f2d616..020e49f77c 100644
--- a/midx.h
+++ b/midx.h
@@ -63,6 +63,10 @@ struct multi_pack_index {
const unsigned char *chunk_revindex;
size_t chunk_revindex_len;
+ struct multi_pack_index *base_midx;
+ uint32_t num_objects_in_base;
+ uint32_t num_packs_in_base;
+
const char **pack_names;
struct packed_git **packs;
char object_dir[FLEX_ARRAY];