Skip to main content

Module protocol_v2

Module protocol_v2 

Source
Expand description

Pure protocol-v2 capability parsing and request-fragment building.

These helpers operate purely on the textual capability/feature lines exchanged during a Git wire-protocol-v2 conversation (the lines between version 2 and the first flush, plus the space-separated feature list inside a fetch= capability). They have no I/O, no environment access, and no transport-backend coupling, so they are shared by every v2 client transport (file://, git://, ssh, smart-HTTP) rather than duplicated per backend.

See Documentation/gitprotocol-v2.txt and serve.c / connect.c / fetch-pack.c in Git.

Functions§

cap_lines_for_command_request
Build the capability lines a client echoes back when issuing a follow-up v2 command (e.g. command=bundle-uri or command=fetch).
fetch_features
Collect the space-separated feature tokens advertised by the server’s v2 fetch= capability.
fetch_supports_feature
True when the server’s v2 fetch= capability lists <feature>.
fetch_supports_filter
True when the server’s v2 fetch= capability advertises filter (so the client may send a filter <spec> line).
fetch_supports_ref_in_want
True when the server’s v2 fetch= capability advertises ref-in-want (so the client may send want-ref <name> lines instead of resolving named refspecs to OIDs itself).
fetch_supports_sideband_all
True when the server’s fetch= capability advertises sideband-all.
server_advertises_bundle_uri
True when the server’s v2 capability advertisement offers the bundle-uri command.