[PATCH 0/7] odb: introduce object storage extension
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 19, 2026, 08:55 UTC
- Message-ID
- <20261019-b4-pks-odb-extension-v1-0-143a5963b77f@pks.im>
Hi,
this patch series introduces the object storage extension. The extension is of course similar in spirit and design to the ref storage extension: it can be configured via "extensions.objectStorage", has the same syntax with "<schema>[://<payload>]", and we have the same mechanisms to configure it ("--object-storage-format=", GIT_OBJECT_STORAGE_FORMAT, GIT_DEFAULT_OBJECT_STORAGE_FORMAT, "init.defaultObjetcStorageFormat").
For now, we only support the "files" object storage format, so not a lot of stuff really changes. That being said, its optional payload allows you to configure a different location for the ".git/objects" directory. So if you specify "extensions.objectStorage=files://objs", objects would be stored in ".git/objs" instead.
The series is built on top of c51408889c (The 6th batch, 2026-10-16) with the following dependencies merged into it:
- ps/odb-files-alternates at 0ba59c8453 (odb/source: drop
`read_alternates` callback, 2026-10-08) merged into it. - ps/setup-enforce-repo-passed-to-create-repository-has-no-state
(phew, what a mouthful) at 0ba59c8453 (odb/source: drop
`read_alternates` callback, 2026-10-08).Note that these two series conflict with one another. The conflict can easily be resolved by just deleting the whole conflicting sections.
Thanks!
Patrick
---
Patrick Steinhardt (7):
loose: drop unused `repo_write_loose_object_map()`
setup: introduce object storage extension
setup: allow overriding object storage format via environment
builtin: expose the object storage format
builtin/init: introduce handling of object storage format
builtin/clone: introduce "--object-storage-format="
builtin/submodule: propagate "--object-storage-format="Documentation/config/extensions.adoc | 23 +++ Documentation/config/init.adoc | 5 + Documentation/git-clone.adoc | 11 ++ Documentation/git-init.adoc | 10 +- Documentation/git-repo.adoc | 6 + Documentation/git-rev-parse.adoc | 5 + Documentation/git-submodule.adoc | 10 +- Documentation/git.adoc | 10 ++ Documentation/object-storage-format.adoc | 6 + builtin/clone.c | 58 +++++++- builtin/init-db.c | 7 +- builtin/repo.c | 10 ++ builtin/rev-parse.c | 7 + builtin/submodule--helper.c | 28 ++++ environment.h | 1 + git-submodule.sh | 18 +++ loose.c | 46 ------ loose.h | 1 - odb.c | 2 +- odb/source-files.c | 7 + odb/source-files.h | 1 + odb/source.c | 48 ++++++- odb/source.h | 12 +- repository.c | 8 ++ repository.h | 8 ++ setup.c | 116 ++++++++++++++- setup.h | 2 + t/meson.build | 1 + t/t0001-init.sh | 221 +++++++++++++++++++++++++++++ t/t1900-repo-info.sh | 3 + t/t5601-clone.sh | 68 +++++++++ t/t7427-submodule-object-storage-format.sh | 91 ++++++++++++ 32 files changed, 788 insertions(+), 62 deletions(-)
--- base-commit: 0d31382da9336683214372ba328fe9ecbc8bcb9a change-id: 20261006-b4-pks-odb-extension-36de693bb943