aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/commit-graph.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2025-10-27 00:44:02 +0000
committerJunio C Hamano <gitster@pobox.com>2025-10-29 07:35:01 -0700
commit54fe83a6623f3e3cc55a1064fcadc17828975448 (patch)
tree38bb9a9f62bf238ef1b7042af42b5e8a43a1f565 /builtin/commit-graph.c
parentrust: add functionality to hash an object (diff)
downloadgit-54fe83a6623f3e3cc55a1064fcadc17828975448.tar.gz
git-54fe83a6623f3e3cc55a1064fcadc17828975448.zip
rust: add a new binary loose object map format
Our current loose object format has a few problems. First, it is not efficient: the list of object IDs is not sorted and even if it were, there would not be an efficient way to look up objects in both algorithms. Second, we need to store mappings for things which are not technically loose objects but are not packed objects, either, and so cannot be stored in a pack index. These kinds of things include shallows, their parents, and their trees, as well as submodules. Yet we also need to implement a sensible way to store the kind of object so that we can prune unneeded entries. For instance, if the user has updated the shallows, we can remove the old values. For these reasons, introduce a new binary loose object map format. The careful reader will notice that it resembles very closely the pack index v3 format. Add an in-memory loose object map as well, and allow enabling writing to a batched map, which can then be written later as one of the binary loose object maps. Include several tests for round tripping and data lookup across algorithms. Note that the use of this code elsewhere in Git will involve some C code and some C-compatible code in Rust that will be introduced in a future commit. Thus, for example, we ignore the fact that if there is no current batch and the caller asks for data to be written, this code does nothing, mostly because this code also does not involve itself with opening or manipulating files. The C code that we will add later will implement this functionality at a higher level and take care of this, since the code which is necessary for writing to the object store is deeply involved with our C abstractions and it would require extensive work (which would not be especially valuable at this point) to port those to Rust. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit-graph.c')
0 files changed, 0 insertions, 0 deletions