Skip to content

Commit 9bfa0f9

Browse files
committed
Merge branch 'bw/protocol-v2'
The beginning of the next-gen transfer protocol. * bw/protocol-v2: (35 commits) remote-curl: don't request v2 when pushing remote-curl: implement stateless-connect command http: eliminate "# service" line when using protocol v2 http: don't always add Git-Protocol header http: allow providing extra headers for http requests remote-curl: store the protocol version the server responded with remote-curl: create copy of the service name pkt-line: add packet_buf_write_len function transport-helper: introduce stateless-connect transport-helper: refactor process_connect_service transport-helper: remove name parameter connect: don't request v2 when pushing connect: refactor git_connect to only get the protocol version once fetch-pack: support shallow requests fetch-pack: perform a fetch using v2 upload-pack: introduce fetch server command push: pass ref prefixes when pushing fetch: pass ref prefixes when fetching ls-remote: pass ref prefixes when requesting a remote's refs transport: convert transport_get_remote_refs to take a list of ref prefixes ...
2 parents 1f1cddd + a4d78ce commit 9bfa0f9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+3318
-368
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
/git-rm
141141
/git-send-email
142142
/git-send-pack
143+
/git-serve
143144
/git-sh-i18n
144145
/git-sh-i18n--envsubst
145146
/git-sh-setup

Documentation/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ TECH_DOCS += technical/pack-heuristics
7878
TECH_DOCS += technical/pack-protocol
7979
TECH_DOCS += technical/protocol-capabilities
8080
TECH_DOCS += technical/protocol-common
81+
TECH_DOCS += technical/protocol-v2
8182
TECH_DOCS += technical/racy-git
8283
TECH_DOCS += technical/send-pack-pipeline
8384
TECH_DOCS += technical/shallow

Documentation/gitremote-helpers.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,14 @@ Capabilities for Pushing
102102
+
103103
Supported commands: 'connect'.
104104

105+
'stateless-connect'::
106+
Experimental; for internal use only.
107+
Can attempt to connect to a remote server for communication
108+
using git's wire-protocol version 2. See the documentation
109+
for the stateless-connect command for more information.
110+
+
111+
Supported commands: 'stateless-connect'.
112+
105113
'push'::
106114
Can discover remote refs and push local commits and the
107115
history leading up to them to new or existing remote refs.
@@ -136,6 +144,14 @@ Capabilities for Fetching
136144
+
137145
Supported commands: 'connect'.
138146

147+
'stateless-connect'::
148+
Experimental; for internal use only.
149+
Can attempt to connect to a remote server for communication
150+
using git's wire-protocol version 2. See the documentation
151+
for the stateless-connect command for more information.
152+
+
153+
Supported commands: 'stateless-connect'.
154+
139155
'fetch'::
140156
Can discover remote refs and transfer objects reachable from
141157
them to the local object store.
@@ -375,6 +391,22 @@ Supported if the helper has the "export" capability.
375391
+
376392
Supported if the helper has the "connect" capability.
377393

394+
'stateless-connect' <service>::
395+
Experimental; for internal use only.
396+
Connects to the given remote service for communication using
397+
git's wire-protocol version 2. Valid replies to this command
398+
are empty line (connection established), 'fallback' (no smart
399+
transport support, fall back to dumb transports) and just
400+
exiting with error message printed (can't connect, don't bother
401+
trying to fall back). After line feed terminating the positive
402+
(empty) response, the output of the service starts. Messages
403+
(both request and response) must consist of zero or more
404+
PKT-LINEs, terminating in a flush packet. The client must not
405+
expect the server to store any state in between request-response
406+
pairs. After the connection ends, the remote helper exits.
407+
+
408+
Supported if the helper has the "stateless-connect" capability.
409+
378410
If a fatal error occurs, the program writes the error message to
379411
stderr and exits. The caller should expect that a suitable error
380412
message has been printed if the child closes the connection without

0 commit comments

Comments
 (0)