]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'bw/protocol-v1'
authorJunio C Hamano <gitster@pobox.com>
Wed, 6 Dec 2017 17:23:44 +0000 (09:23 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Dec 2017 17:23:44 +0000 (09:23 -0800)
A new mechanism to upgrade the wire protocol in place is proposed
and demonstrated that it works with the older versions of Git
without harming them.

* bw/protocol-v1:
  Documentation: document Extra Parameters
  ssh: introduce a 'simple' ssh variant
  i5700: add interop test for protocol transition
  http: tell server that the client understands v1
  connect: tell server that the client understands v1
  connect: teach client to recognize v1 server response
  upload-pack, receive-pack: introduce protocol version 1
  daemon: recognize hidden request arguments
  protocol: introduce protocol extension mechanisms
  pkt-line: add packet_write function
  connect: in ref advertisement, shallows are last

1  2 
Documentation/config.txt
Documentation/git.txt
Makefile
builtin/receive-pack.c
cache.h
http.c
pkt-line.c
t/t5601-clone.sh
upload-pack.c

Simple merge
index 483a1f35475ea435e5c93121e67ad8085855bfc3,8bc3f21473b339983c6b4456a83a8393e7b15616..e75db104e3a33dde93a98cc09de97f4d4f0bc5eb
@@@ -705,32 -696,12 +704,38 @@@ of clones and fetches
        which feed potentially-untrusted URLS to git commands.  See
        linkgit:git-config[1] for more details.
  
+ `GIT_PROTOCOL`::
+       For internal use only.  Used in handshaking the wire protocol.
+       Contains a colon ':' separated list of keys with optional values
+       'key[=value]'.  Presence of unknown keys and values must be
+       ignored.
 +`GIT_OPTIONAL_LOCKS`::
 +      If set to `0`, Git will complete any requested operation without
 +      performing any optional sub-operations that require taking a lock.
 +      For example, this will prevent `git status` from refreshing the
 +      index as a side effect. This is useful for processes running in
 +      the background which do not want to cause lock contention with
 +      other operations on the repository.  Defaults to `1`.
 +
 +`GIT_REDIRECT_STDIN`::
 +`GIT_REDIRECT_STDOUT`::
 +`GIT_REDIRECT_STDERR`::
 +      Windows-only: allow redirecting the standard input/output/error
 +      handles to paths specified by the environment variables. This is
 +      particularly useful in multi-threaded applications where the
 +      canonical way to pass standard handles via `CreateProcess()` is
 +      not an option because it would require the handles to be marked
 +      inheritable (and consequently *every* spawned process would
 +      inherit them, possibly blocking regular Git operations). The
 +      primary intended use case is to use named pipes for communication
 +      (e.g. `\\.\pipe\my-git-stdin-123`).
 ++
 +Two special values are supported: `off` will simply close the
 +corresponding standard handle, and if `GIT_REDIRECT_STDERR` is
 +`2>&1`, standard error will be redirected to the same handle as
 +standard output.
 +
  Discussion[[Discussion]]
  ------------------------
  
diff --cc Makefile
Simple merge
Simple merge
diff --cc cache.h
index 2e143450514c88ec30b447c8a94e280be9105aa0,3a6b869c2a26aea682a160ac993e06ab60d2b45b..cb5db7bf83053f675acebe4f8255f52881425773
+++ b/cache.h
@@@ -448,8 -444,17 +448,18 @@@ static inline enum object_type object_t
  #define GIT_NOGLOB_PATHSPECS_ENVIRONMENT "GIT_NOGLOB_PATHSPECS"
  #define GIT_ICASE_PATHSPECS_ENVIRONMENT "GIT_ICASE_PATHSPECS"
  #define GIT_QUARANTINE_ENVIRONMENT "GIT_QUARANTINE_PATH"
 +#define GIT_OPTIONAL_LOCKS_ENVIRONMENT "GIT_OPTIONAL_LOCKS"
  
+ /*
+  * Environment variable used in handshaking the wire protocol.
+  * Contains a colon ':' separated list of keys with optional values
+  * 'key[=value]'.  Presence of unknown keys and values must be
+  * ignored.
+  */
+ #define GIT_PROTOCOL_ENVIRONMENT "GIT_PROTOCOL"
+ /* HTTP header used to handshake the wire protocol */
+ #define GIT_PROTOCOL_HEADER "Git-Protocol"
  /*
   * This environment variable is expected to contain a boolean indicating
   * whether we should or should not treat:
diff --cc http.c
Simple merge
diff --cc pkt-line.c
Simple merge
index 50e40abb11e1d317a2a58321f1007dde925c8da2,86811a0c35f0a1baf23ce81a5829adf7b896548a..ef94af9fccf1f76f4b0b86994ea823a37e996b33
@@@ -308,10 -308,9 +308,10 @@@ test_expect_success 'clone checking ou
  
  setup_ssh_wrapper () {
        test_expect_success 'setup ssh wrapper' '
-               rm -f "$TRASH_DIRECTORY/ssh-wrapper$X" &&
++              rm -f "$TRASH_DIRECTORY/ssh$X" &&
                cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \
-                       "$TRASH_DIRECTORY/ssh-wrapper$X" &&
-               GIT_SSH="$TRASH_DIRECTORY/ssh-wrapper$X" &&
+                       "$TRASH_DIRECTORY/ssh$X" &&
+               GIT_SSH="$TRASH_DIRECTORY/ssh$X" &&
                export GIT_SSH &&
                export TRASH_DIRECTORY &&
                >"$TRASH_DIRECTORY"/ssh-output
  }
  
  copy_ssh_wrapper_as () {
-       cp "$TRASH_DIRECTORY/ssh-wrapper$X" "${1%$X}$X" &&
 +      rm -f "${1%$X}$X" &&
+       cp "$TRASH_DIRECTORY/ssh$X" "${1%$X}$X" &&
        GIT_SSH="${1%$X}$X" &&
        export GIT_SSH
  }
diff --cc upload-pack.c
Simple merge