]> git.ipfire.org Git - thirdparty/git.git/commit
builtin/submodule: allow cloning with different ref storage format
authorPatrick Steinhardt <ps@pks.im>
Thu, 8 Aug 2024 07:35:32 +0000 (09:35 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Aug 2024 16:20:49 +0000 (09:20 -0700)
commit5ac781ad624a32ca4136eae40b4f416b21f0af96
tree0b724e0bdcf71df4c10c52a5b9216995bfd1782f
parentd9ab8788e1dbc47968235b33a051e76c735961b0
builtin/submodule: allow cloning with different ref storage format

As submodules are proper self-contained repositories, it is perfectly
valid for them to have a different ref storage format than their parent
repository. There is no obvious way for users to ask for the ref storage
format when initializing submodules though. Whether the setup of such
mixed-ref-storage-format constellations is all that useful remains to be
seen. But there is no good reason to not expose such an option, and we
will require it in a subsequent patch.

Introduce a new `--ref-format=` option for git-submodule(1) that allows
the user to pick the ref storage format. This option will also be used
in a subsequent commit, where we start to propagate the same flag from
git-clone(1) to cloning submodules with the `--recursive` switch.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-submodule.txt
builtin/submodule--helper.c
git-submodule.sh
t/t7424-submodule-mixed-ref-formats.sh [new file with mode: 0755]