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 9bfa0f9be3e718f701200a242ea04259a4dc4dfc
Showing with 3,318 additions and 368 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 Documentation/Makefile
  3. +32 −0 Documentation/gitremote-helpers.txt
  4. +395 −0 Documentation/technical/protocol-v2.txt
  5. +6 −1 Makefile
  6. +2 −0 builtin.h
  7. +1 −1 builtin/clone.c
  8. +18 −2 builtin/fetch-pack.c
  9. +19 −2 builtin/fetch.c
  10. +13 −2 builtin/ls-remote.c
  11. +6 −0 builtin/receive-pack.c
  12. +1 −1 builtin/remote.c
  13. +18 −2 builtin/send-pack.c
  14. +30 −0 builtin/serve.c
  15. +74 −0 builtin/upload-pack.c
  16. +269 −95 connect.c
  17. +7 −0 connect.h
  18. +333 −6 fetch-pack.c
  19. +3 −1 fetch-pack.h
  20. +2 −0 git.c
  21. +6 −2 http-backend.c
  22. +8 −17 http.c
  23. +7 −0 http.h
  24. +96 −0 ls-refs.c
  25. +10 −0 ls-refs.h
  26. +119 −14 pkt-line.c
  27. +78 −0 pkt-line.h
  28. +2 −0 protocol.c
  29. +1 −0 protocol.h
  30. +14 −0 refs.c
  31. +7 −0 refs.h
  32. +276 −4 remote-curl.c
  33. +9 −2 remote.h
  34. +257 −0 serve.c
  35. +15 −0 serve.h
  36. +64 −0 t/helper/test-pkt-line.c
  37. +176 −0 t/t5701-git-serve.sh
  38. +273 −0 t/t5702-protocol-v2.sh
  39. +54 −33 transport-helper.c
  40. +10 −1 transport-internal.h
  41. +99 −31 transport.c
  42. +17 −1 transport.h
  43. +466 −150 upload-pack.c
  44. +23 −0 upload-pack.h
@@ -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
Oops, something went wrong.

0 comments on commit 9bfa0f9

Please sign in to comment.