Files
git/Documentation/object-storage-format.adoc
Patrick Steinhardt c3b60bb311 setup: introduce object storage extension
Introduce a new "extensions.objectStorage" extension that allows the
user to configure the primary object database source of a repository.
The value is a URI in the format "<schema>[://<payload>]", mirroring
the format used by "extensions.refStorage":

  - The schema identifies the backend that shall be used. For now the
    only supported schema is "files", which is the existing object
    database backed by loose objects and packfiles.

  - The payload can be passed to configure the backend, and its
    interpretation is backend-specific. For the "files" backend, it
    allows you to configure a different location for the ".git/objects"
    directory.

Making the location of the "files" backend configurable is not the most
thrilling feature of this new extension. But it gives us a couple of
advantages:

  - It allows us to start exercising the payload logic in our tests so
    that we know it's working properly for backends that will need it.

  - It allows us to easily detect tests that are broken with the new
    extension because they for example assume that an object is a file
    in ".git/objects/". Testing is not part of this series yet, but will
    be done in subsequent patch series.

  - It aligns with how we handle the ref storage extension, where we can
    also change its location to an arbitrary path.

  - It allows for some very esoteric and edge-case-y gimmicks. For
    example, you can initialize a single repository "skeleton" and then
    multiplex therein by setting both GIT_REF_STORAGE_FORMAT and
    GIT_OBJECT_STORAGE_FORMAT to point to different databases. These
    edge cases won't matter to many people out there, but we will use
    this for example as a building block for migrations.

Eventually, this mechanism will be used to support alternative backends.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-10-29 11:09:31 -07:00

7 lines
377 B
Plaintext

`files[://<path>]`;; for loose objects and packfiles. This is the default.
+
The optional payload can be passed to specify an alternative filesystem path
where the objects will be stored. Relative paths are resolved relative to the
`$GIT_COMMON_DIR`. Defaults to `$GIT_COMMON_DIR/objects` when no payload is
provided. The payload is ignored when `GIT_OBJECT_DIRECTORY` is set.