]> git.ipfire.org Git - thirdparty/git.git/commit - t/t5558-clone-bundle-uri.sh
bundle-uri: fetch a list of bundles
authorDerrick Stolee <derrickstolee@github.com>
Wed, 12 Oct 2022 12:52:36 +0000 (12:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 12 Oct 2022 16:13:25 +0000 (09:13 -0700)
commitc23f592117bac30765ca22545386c3e9304da803
tree4451c77b029ac94532dcf33b8c6d22846a2f1590
parentc96060b0cef79c9d76eb97965e700beb9651f35b
bundle-uri: fetch a list of bundles

When the content at a given bundle URI is not understood as a bundle
(based on inspecting the initial content), then Git currently gives up
and ignores that content. Independent bundle providers may want to split
up the bundle content into multiple bundles, but still make them
available from a single URI.

Teach Git to attempt parsing the bundle URI content as a Git config file
providing the key=value pairs for a bundle list. Git then looks at the
mode of the list to see if ANY single bundle is sufficient or if ALL
bundles are required. The content at the selected URIs are downloaded
and the content is inspected again, creating a recursive process.

To guard the recursion against malformed or malicious content, limit the
recursion depth to a reasonable four for now. This can be converted to a
configured value in the future if necessary. The value of four is twice
as high as expected to be useful (a bundle list is unlikely to point to
more bundle lists).

To test this scenario, create an interesting bundle topology where three
incremental bundles are built on top of a single full bundle. By using a
merge commit, the two middle bundles are "independent" in that they do
not require each other in order to unbundle themselves. They each only
need the base bundle. The bundle containing the merge commit requires
both of the middle bundles, though. This leads to some interesting
decisions when unbundling, especially when we later implement heuristics
that promote downloading bundles until the prerequisite commits are
satisfied.

Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bundle-uri.c
bundle-uri.h
t/t5558-clone-bundle-uri.sh