From: Junio C Hamano Date: Wed, 6 Dec 2017 17:23:44 +0000 (-0800) Subject: Merge branch 'bw/protocol-v1' X-Git-Tag: v2.16.0-rc0~69 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4c6dad0059b2b5d1ea996ccf67f93224955b07b4?hp=--cc Merge branch 'bw/protocol-v1' 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 --- 4c6dad0059b2b5d1ea996ccf67f93224955b07b4 diff --cc Documentation/git.txt index 483a1f3547,8bc3f21473..e75db104e3 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@@ -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 cache.h index 2e14345051,3a6b869c2a..cb5db7bf83 --- a/cache.h +++ 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 t/t5601-clone.sh index 50e40abb11,86811a0c35..ef94af9fcc --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@@ -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 @@@ -319,8 -318,7 +319,8 @@@ } copy_ssh_wrapper_as () { + rm -f "${1%$X}$X" && - cp "$TRASH_DIRECTORY/ssh-wrapper$X" "${1%$X}$X" && + cp "$TRASH_DIRECTORY/ssh$X" "${1%$X}$X" && GIT_SSH="${1%$X}$X" && export GIT_SSH }