Skip to content

Commit 2834a72

Browse files
peffgitster
authored andcommitted
docs/git: discuss server-side config for GIT_PROTOCOL
The v2 protocol requires that the GIT_PROTOCOL environment variable gets passed around, but we don't have any documentation describing how this is supposed to work. In particular, we need to note what server admins might need to configure to make things work. The definition of the GIT_PROTOCOL variable is probably the best place for this, since: - we deal with multiple transports (ssh, http, etc). Transport-specific documentation (like the git-http-backend bits added in the previous commit) are helpful for those transports, but this gives a broader overview. Plus we do not have a specific transport endpoint program for ssh, so this is a reasonable place to mention it. - the server side of the protocol involves multiple programs. For now, upload-pack is the only endpoint which uses GIT_PROTOCOL, but that will likely expand in the future. We're better off with a central discussion of what the server admin might need to do. However, for discoverability, this patch adds a pointer from upload-pack's documentation. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 295d81b commit 2834a72

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Documentation/git-upload-pack.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ OPTIONS
4444
<directory>::
4545
The repository to sync from.
4646

47+
ENVIRONMENT
48+
-----------
49+
50+
`GIT_PROTOCOL`::
51+
Internal variable used for handshaking the wire protocol. Server
52+
admins may need to configure some transports to allow this
53+
variable to be passed. See the discussion in linkgit:git[1].
54+
4755
SEE ALSO
4856
--------
4957
linkgit:gitnamespaces[7]

Documentation/git.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,21 @@ for full details.
894894
Contains a colon ':' separated list of keys with optional values
895895
'key[=value]'. Presence of unknown keys and values must be
896896
ignored.
897+
+
898+
Note that servers may need to be configured to allow this variable to
899+
pass over some transports. It will be propagated automatically when
900+
accessing local repositories (i.e., `file://` or a filesystem path), as
901+
well as over the `git://` protocol. For git-over-http, it should work
902+
automatically in most configurations, but see the discussion in
903+
linkgit:git-http-backend[1]. For git-over-ssh, the ssh server may need
904+
to be configured to allow clients to pass this variable (e.g., by using
905+
`AcceptEnv GIT_PROTOCOL` with OpenSSH).
906+
+
907+
This configuration is optional. If the variable is not propagated, then
908+
clients will fall back to the original "v0" protocol (but may miss out
909+
on some performance improvements or features). This variable currently
910+
only affects clones and fetches; it is not yet used for pushes (but may
911+
be in the future).
897912

898913
`GIT_OPTIONAL_LOCKS`::
899914
If set to `0`, Git will complete any requested operation without

0 commit comments

Comments
 (0)