]> git.ipfire.org Git - thirdparty/git.git/commit - serve.c
protocol v2: add server-side "bundle-uri" skeleton
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 22 Dec 2022 15:14:07 +0000 (15:14 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 25 Dec 2022 07:24:23 +0000 (16:24 +0900)
commit8b8d9a229888adb737851c4d7eeaa9a50e37afe1
tree493ead914a9d321e4a14ea63cf122e36ee1f4cf2
parenteea7033409a0ed713c78437fc76486983d211e25
protocol v2: add server-side "bundle-uri" skeleton

Add a skeleton server-side implementation of a new "bundle-uri" command
to protocol v2. This will allow conforming clients to optionally seed
their initial clones or incremental fetches from URLs containing
"*.bundle" files created with "git bundle create".

This change only performs the basic boilerplate of advertising a new
protocol v2 capability. The new 'bundle-uri' capability allows a client
to request a list of bundles. Right now, the server only returns a flush
packet, which corresponds to an empty advertisement. The bundle.* config
namespace describes which key-value pairs will be communicated across
this interface in future updates.

The critical bit right now is that the new boolean
uploadPack.adverstiseBundleURIs config value signals whether or not this
capability should be advertised at all.

An earlier version of this patch [1] used a different transfer format
than the "key=value" pairs in the current implementation. The change was
made to unify the protocol v2 command with the bundle lists provided by
independent bundle servers. Further, the standard allows for the server
to advertise a URI that contains a bundle list. This allows users
automatically discovering bundle providers that are loosely associated
with the origin server, but without the origin server knowing exactly
which bundles are currently available.

[1] https://lore.kernel.org/git/RFC-patch-v2-01.13-2fc87ce092b-20220311T155841Z-avarab@gmail.com/

The very-deep headings needed to be modified to stop at level 4 due to
documentation build issues. These were not recognized in earlier builds
since the file was previously in the Documentation/technical/ directory
and was built in a different way. With its current location, the
heavily-nested details were causing build issues and they are now
replaced with a bulletted list of details.

Co-authored-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/gitprotocol-v2.txt
bundle-uri.c
bundle-uri.h
serve.c
t/t5701-git-serve.sh