Re: [PATCH v4 0/7] odb: introduce object storage extension
Patrick Steinhardt <ps@pks.im> writes:
[snip]
Show 9 quoted lines
> Range-diff versus v3:
>
> 1: 906c3d3e3c3 = 1: f09fc3200f9 loose: drop unused `repo_write_loose_object_map()`
> 2: 3d3bcf0f825 ! 2: 655e1de3b9d setup: introduce object storage extension
> @@ Commit message
> allows you to configure a different location for the ".git/objects"
> directory.
>
> + Making the location of the "files" backend configurable is not he most
Show 39 quoted lines
> + 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>
> @@ setup.c: static enum extension_result handle_extension(const char *var,
> return EXTENSION_OK;
> } else if (!strcmp(ext, "relativeworktrees")) {
> data->relative_worktrees = git_config_bool(var, value);
> -@@ setup.c: static enum extension_result handle_extension(const char *var,
> - data->submodule_path_cfg = git_config_bool(var, value);
> - return EXTENSION_OK;
> - }
> -+
> - return EXTENSION_UNKNOWN;
> - }
> -
> @@ setup.c: void clear_repository_format(struct repository_format *format)
> free(format->work_tree);
> free(format->partial_clone);[snip]
The rest looks good. Overall I'm happy with this version!