Skip to content
Permalink
Browse files
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
  ...
  • Loading branch information
gitster committed May 8, 2018
2 parents 1f1cddd + a4d78ce commit 9bfa0f9
Show file tree
Hide file tree
Showing 44 changed files with 3,318 additions and 368 deletions.
@@ -140,6 +140,7 @@
/git-rm
/git-send-email
/git-send-pack
/git-serve
/git-sh-i18n
/git-sh-i18n--envsubst
/git-sh-setup
@@ -78,6 +78,7 @@ TECH_DOCS += technical/pack-heuristics
TECH_DOCS += technical/pack-protocol
TECH_DOCS += technical/protocol-capabilities
TECH_DOCS += technical/protocol-common
TECH_DOCS += technical/protocol-v2
TECH_DOCS += technical/racy-git
TECH_DOCS += technical/send-pack-pipeline
TECH_DOCS += technical/shallow
@@ -102,6 +102,14 @@ Capabilities for Pushing
+
Supported commands: 'connect'.

'stateless-connect'::
Experimental; for internal use only.
Can attempt to connect to a remote server for communication
using git's wire-protocol version 2. See the documentation
for the stateless-connect command for more information.
+
Supported commands: 'stateless-connect'.

'push'::
Can discover remote refs and push local commits and the
history leading up to them to new or existing remote refs.
@@ -136,6 +144,14 @@ Capabilities for Fetching
+
Supported commands: 'connect'.

'stateless-connect'::
Experimental; for internal use only.
Can attempt to connect to a remote server for communication
using git's wire-protocol version 2. See the documentation
for the stateless-connect command for more information.
+
Supported commands: 'stateless-connect'.

'fetch'::
Can discover remote refs and transfer objects reachable from
them to the local object store.
@@ -375,6 +391,22 @@ Supported if the helper has the "export" capability.
+
Supported if the helper has the "connect" capability.

'stateless-connect' <service>::
Experimental; for internal use only.
Connects to the given remote service for communication using
git's wire-protocol version 2. Valid replies to this command
are empty line (connection established), 'fallback' (no smart
transport support, fall back to dumb transports) and just
exiting with error message printed (can't connect, don't bother
trying to fall back). After line feed terminating the positive
(empty) response, the output of the service starts. Messages
(both request and response) must consist of zero or more
PKT-LINEs, terminating in a flush packet. The client must not
expect the server to store any state in between request-response
pairs. After the connection ends, the remote helper exits.
+
Supported if the helper has the "stateless-connect" capability.

If a fatal error occurs, the program writes the error message to
stderr and exits. The caller should expect that a suitable error
message has been printed if the child closes the connection without

0 comments on commit 9bfa0f9

Please sign in to comment.