{"thread":{"id":"50590","subject":"[PATCH 0/8] GIT_TEST_PROTOCOL_VERSION, this time on master","startedAt":"2019-02-25T21:54:21Z","lastAt":"2019-02-25T21:54:45Z","messageCount":9,"participants":["Jonathan Tan"],"isPatch":true,"patchVersion":1,"patchTotal":8},"messages":[{"id":"370144","messageId":"cover.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":null,"subject":"[PATCH 0/8] GIT_TEST_PROTOCOL_VERSION, this time on master","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:05Z","receivedAt":"2019-02-25T21:54:21Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"There's a version of this in Junio's Git repository as\njt/test-protocol-version, blocked by js/protocol-advertise-multi. After\nchatting with Josh (the author of js/protocol-advertise-multi) last\nweek, it seems that that branch might take a while, so I have decided to\nrebase my patches on master.\n\nThis necessitates patch 2, which contains additional updates to t5601,\nso that all tests pass with GIT_TEST_PROTOCOL_VERSION=1.\n(js/protocol-advertise-multi eliminates the need to do that, which is\nwhy these changes did not appear in the previous version.) When\njs/protocol-advertise-multi is merged, we can and should revert patch 2.\n\nI have incorporated a small suggestion by Peff [1], and he seems overall\nOK with the patch set [2].\n\nI have based my work on the existing contents of\njt/test-protocol-version, so most commits include a \"Signed-off-by\" line by\nJunio. Let me know if you prefer it to be removed.\n\n[1] https://public-inbox.org/git/20190211201959.GA9072@sigill.intra.peff.net/\n[2] https://public-inbox.org/git/20190211203827.GA9010@sigill.intra.peff.net/\n\nHere is a range-diff.\n\n1:  7ed58eb98b ! 1:  4dcd898813 tests: define GIT_TEST_PROTOCOL_VERSION\n    @@ -8,9 +8,8 @@\n         configuration is in place for all repositories.\n     \n         As of this patch, all tests pass whether GIT_TEST_PROTOCOL_VERSION is\n    -    unset, set to 0, or set to 1. Some tests fail when\n    -    GIT_TEST_PROTOCOL_VERSION is set to 2, but this will be dealt with in\n    -    subsequent patches.\n    +    unset or set to 0. Some tests fail when GIT_TEST_PROTOCOL_VERSION is set\n    +    to 1 or 2, but this will be dealt with in subsequent patches.\n     \n         This is based on work by Ævar Arnfjörð Bjarmason.\n     \n    @@ -39,7 +38,7 @@\n     +\t\tretval = version;\n     +\t}\n     +\n    -+\tif (git_test_v && strlen(git_test_v)) {\n    ++\tif (git_test_v && *git_test_v) {\n     +\t\tenum protocol_version env = parse_protocol_version(git_test_v);\n     +\n     +\t\tif (env == protocol_unknown_version)\n    @@ -52,7 +51,7 @@\n     +\treturn retval;\n      }\n      \n    - void register_allowed_protocol_version(enum protocol_version version)\n    + enum protocol_version determine_protocol_version_server(void)\n     \n      diff --git a/t/README b/t/README\n      --- a/t/README\n-:  ---------- > 2:  1c865e4ae9 t5601: check ssh command only with protocol v0\n2:  1b3c299528 = 3:  227a88aa8c tests: always test fetch of unreachable with v0\n3:  526670b1d5 = 4:  8f510c5c78 t5503: fix overspecification of trace expectation\n4:  1548be81a5 = 5:  9aaabdac52 t5512: compensate for v0 only sending HEAD symrefs\n5:  1da961b33a = 6:  6c29e64bc3 t5700: only run with protocol version 1\n6:  3c22aaad5b = 7:  d4638e9418 tests: fix protocol version for overspecifications\n7:  188754ca3f = 8:  629a243c7f t5552: compensate for v2 filtering ref adv.\n\nJonathan Tan (8):\n  tests: define GIT_TEST_PROTOCOL_VERSION\n  t5601: check ssh command only with protocol v0\n  tests: always test fetch of unreachable with v0\n  t5503: fix overspecification of trace expectation\n  t5512: compensate for v0 only sending HEAD symrefs\n  t5700: only run with protocol version 1\n  tests: fix protocol version for overspecifications\n  t5552: compensate for v2 filtering ref adv.\n\n protocol.c                           | 17 ++++++++--\n t/README                             |  3 ++\n t/t5400-send-pack.sh                 |  2 +-\n t/t5500-fetch-pack.sh                |  4 ++-\n t/t5503-tagfollow.sh                 |  2 +-\n t/t5512-ls-remote.sh                 | 18 ++++++++---\n t/t5515-fetch-merge-logic.sh         |  4 +++\n t/t5516-fetch-push.sh                | 22 ++++++++++---\n t/t5539-fetch-http-shallow.sh        |  5 ++-\n t/t5541-http-push-smart.sh           | 14 +++++++--\n t/t5551-http-fetch-smart.sh          | 47 +++++++++++++++++++++-------\n t/t5552-skipping-fetch-negotiator.sh |  5 ++-\n t/t5601-clone.sh                     | 16 +++++-----\n t/t5700-protocol-v1.sh               |  3 ++\n t/t7406-submodule-update.sh          |  5 ++-\n 15 files changed, 128 insertions(+), 39 deletions(-)\n\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370145","messageId":"4dcd89881317eb97886e1ba0377ae6fff4edc1da.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 1/8] tests: define GIT_TEST_PROTOCOL_VERSION","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:06Z","receivedAt":"2019-02-25T21:54:23Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"Define a GIT_TEST_PROTOCOL_VERSION environment variable meant to be used\nfrom tests. When set, this ensures protocol.version is at least the\ngiven value, allowing the entire test suite to be run as if this\nconfiguration is in place for all repositories.\n\nAs of this patch, all tests pass whether GIT_TEST_PROTOCOL_VERSION is\nunset or set to 0. Some tests fail when GIT_TEST_PROTOCOL_VERSION is set\nto 1 or 2, but this will be dealt with in subsequent patches.\n\nThis is based on work by Ævar Arnfjörð Bjarmason.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n protocol.c                  | 17 +++++++++++++++--\n t/README                    |  3 +++\n t/t5400-send-pack.sh        |  2 +-\n t/t5551-http-fetch-smart.sh |  3 ++-\n 4 files changed, 21 insertions(+), 4 deletions(-)\n\ndiff --git a/protocol.c b/protocol.c\nindex 5e636785d1..9741f05750 100644\n--- a/protocol.c\n+++ b/protocol.c\n@@ -17,6 +17,10 @@ static enum protocol_version parse_protocol_version(const char *value)\n enum protocol_version get_protocol_version_config(void)\n {\n \tconst char *value;\n+\tenum protocol_version retval = protocol_v0;\n+\tconst char *git_test_k = \"GIT_TEST_PROTOCOL_VERSION\";\n+\tconst char *git_test_v = getenv(git_test_k);\n+\n \tif (!git_config_get_string_const(\"protocol.version\", &value)) {\n \t\tenum protocol_version version = parse_protocol_version(value);\n \n@@ -24,10 +28,19 @@ enum protocol_version get_protocol_version_config(void)\n \t\t\tdie(\"unknown value for config 'protocol.version': %s\",\n \t\t\t    value);\n \n-\t\treturn version;\n+\t\tretval = version;\n+\t}\n+\n+\tif (git_test_v && *git_test_v) {\n+\t\tenum protocol_version env = parse_protocol_version(git_test_v);\n+\n+\t\tif (env == protocol_unknown_version)\n+\t\t\tdie(\"unknown value for %s: %s\", git_test_k, git_test_v);\n+\t\tif (retval < env)\n+\t\t\tretval = env;\n \t}\n \n-\treturn protocol_v0;\n+\treturn retval;\n }\n \n enum protocol_version determine_protocol_version_server(void)\ndiff --git a/t/README b/t/README\nindex 886bbec5bc..3125bfa6b6 100644\n--- a/t/README\n+++ b/t/README\n@@ -341,6 +341,9 @@ marked strings\" in po/README for details.\n GIT_TEST_SPLIT_INDEX=<boolean> forces split-index mode on the whole\n test suite. Accept any boolean values that are accepted by git-config.\n \n+GIT_TEST_PROTOCOL_VERSION=<n>, when set, overrides the\n+'protocol.version' setting to n if it is less than n.\n+\n GIT_TEST_FULL_IN_PACK_ARRAY=<boolean> exercises the uncommon\n pack-objects code path where there are more than 1024 packs even if\n the actual number of packs in repository is below this limit. Accept\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex f1932ea431..571d620aed 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -288,7 +288,7 @@ test_expect_success 'receive-pack de-dupes .have lines' '\n \t$shared .have\n \tEOF\n \n-\tGIT_TRACE_PACKET=$(pwd)/trace \\\n+\tGIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION= \\\n \t    git push \\\n \t\t--receive-pack=\"unset GIT_TRACE_PACKET; git-receive-pack\" \\\n \t\tfork HEAD:foo &&\ndiff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\nindex ba83e567e5..a852684e16 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -43,7 +43,8 @@ test_expect_success 'clone http repository' '\n \t< Cache-Control: no-cache, max-age=0, must-revalidate\n \t< Content-Type: application/x-git-upload-pack-result\n \tEOF\n-\tGIT_TRACE_CURL=true git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err &&\n+\tGIT_TRACE_CURL=true GIT_TEST_PROTOCOL_VERSION= \\\n+\t\tgit clone --quiet $HTTPD_URL/smart/repo.git clone 2>err &&\n \ttest_cmp file clone/file &&\n \ttr '\\''\\015'\\'' Q <err |\n \tsed -e \"\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370146","messageId":"1c865e4ae91d207160f8d41607ceca6d8ca7d775.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 2/8] t5601: check ssh command only with protocol v0","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:07Z","receivedAt":"2019-02-25T21:54:27Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"When running the SSH command as part of a fetch, Git will write \"SendEnv\nGIT_PROTOCOL\" as an option if protocol v1 or v2 is used, but not v0.\nUpdate all tests that check this to run Git with\nGIT_TEST_PROTOCOL_VERSION=0.\n\nI chose not to do a more thorough fix (for example, checking the value of\nGIT_TEST_PROTOCOL_VERSION to see if the SendEnv check needs to be done)\nbecause a set of patches [1] that unifies the handling of SSH options,\nincluding writing \"SendEnv GIT_PROTOCOL\" regardless of protocol version,\nis in progress. When that is done, this patch should be reverted, since\nthe functionality in here is no longer needed.\n\nAs of this patch, all tests pass if GIT_TEST_PROTOCOL_VERSION is set to\n1.\n\n[1] https://public-inbox.org/git/cover.1545342797.git.steadmon@google.com/\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\n---\n t/t5601-clone.sh | 16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/t/t5601-clone.sh b/t/t5601-clone.sh\nindex d6948cbdab..a454b143ea 100755\n--- a/t/t5601-clone.sh\n+++ b/t/t5601-clone.sh\n@@ -345,7 +345,7 @@ expect_ssh () {\n }\n \n test_expect_success 'clone myhost:src uses ssh' '\n-\tgit clone myhost:src ssh-clone &&\n+\tGIT_TEST_PROTOCOL_VERSION=0 git clone myhost:src ssh-clone &&\n \texpect_ssh myhost src\n '\n \n@@ -356,12 +356,12 @@ test_expect_success !MINGW,!CYGWIN 'clone local path foo:bar' '\n '\n \n test_expect_success 'bracketed hostnames are still ssh' '\n-\tgit clone \"[myhost:123]:src\" ssh-bracket-clone &&\n+\tGIT_TEST_PROTOCOL_VERSION=0 git clone \"[myhost:123]:src\" ssh-bracket-clone &&\n \texpect_ssh \"-p 123\" myhost src\n '\n \n test_expect_success 'OpenSSH variant passes -4' '\n-\tgit clone -4 \"[myhost:123]:src\" ssh-ipv4-clone &&\n+\tGIT_TEST_PROTOCOL_VERSION=0 git clone -4 \"[myhost:123]:src\" ssh-ipv4-clone &&\n \texpect_ssh \"-4 -p 123\" myhost src\n '\n \n@@ -405,7 +405,7 @@ test_expect_success 'OpenSSH-like uplink is treated as ssh' '\n \ttest_when_finished \"rm -f \\\"\\$TRASH_DIRECTORY/uplink\\\"\" &&\n \tGIT_SSH=\"$TRASH_DIRECTORY/uplink\" &&\n \ttest_when_finished \"GIT_SSH=\\\"\\$TRASH_DIRECTORY/ssh\\$X\\\"\" &&\n-\tgit clone \"[myhost:123]:src\" ssh-bracket-clone-sshlike-uplink &&\n+\tGIT_TEST_PROTOCOL_VERSION=0 git clone \"[myhost:123]:src\" ssh-bracket-clone-sshlike-uplink &&\n \texpect_ssh \"-p 123\" myhost src\n '\n \n@@ -444,14 +444,14 @@ test_expect_success 'single quoted plink.exe in GIT_SSH_COMMAND' '\n \n test_expect_success 'GIT_SSH_VARIANT overrides plink detection' '\n \tcopy_ssh_wrapper_as \"$TRASH_DIRECTORY/plink\" &&\n-\tGIT_SSH_VARIANT=ssh \\\n-\tgit clone \"[myhost:123]:src\" ssh-bracket-clone-variant-1 &&\n+\tGIT_TEST_PROTOCOL_VERSION=0 GIT_SSH_VARIANT=ssh \\\n+\t\tgit clone \"[myhost:123]:src\" ssh-bracket-clone-variant-1 &&\n \texpect_ssh \"-p 123\" myhost src\n '\n \n test_expect_success 'ssh.variant overrides plink detection' '\n \tcopy_ssh_wrapper_as \"$TRASH_DIRECTORY/plink\" &&\n-\tgit -c ssh.variant=ssh \\\n+\tGIT_TEST_PROTOCOL_VERSION=0 git -c ssh.variant=ssh \\\n \t\tclone \"[myhost:123]:src\" ssh-bracket-clone-variant-2 &&\n \texpect_ssh \"-p 123\" myhost src\n '\n@@ -482,7 +482,7 @@ counter=0\n # $3 path\n test_clone_url () {\n \tcounter=$(($counter + 1))\n-\ttest_might_fail git clone \"$1\" tmp$counter &&\n+\ttest_might_fail env GIT_TEST_PROTOCOL_VERSION=0 git clone \"$1\" tmp$counter &&\n \tshift &&\n \texpect_ssh \"$@\"\n }\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370147","messageId":"227a88aa8ca40663700b434284d3fa3876464dc8.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 3/8] tests: always test fetch of unreachable with v0","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:08Z","receivedAt":"2019-02-25T21:54:29Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"Some tests check that fetching an unreachable object fails, but protocol\nv2 allows such fetches. Unset GIT_TEST_PROTOCOL_VERSION so that these\ntests are always run using protocol v0.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5500-fetch-pack.sh       |  4 +++-\n t/t5516-fetch-push.sh       | 22 +++++++++++++++++-----\n t/t5551-http-fetch-smart.sh | 10 ++++++++--\n t/t7406-submodule-update.sh |  5 ++++-\n 4 files changed, 32 insertions(+), 9 deletions(-)\n\ndiff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh\nindex 49c540b1e1..0ef4d6f20c 100755\n--- a/t/t5500-fetch-pack.sh\n+++ b/t/t5500-fetch-pack.sh\n@@ -636,7 +636,9 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a\n \ttest_commit -C server 6 &&\n \n \tgit init client &&\n-\ttest_must_fail git -C client fetch-pack ../server \\\n+\t# Some protocol versions (e.g. 2) support fetching\n+\t# unadvertised objects, so restrict this test to v0.\n+\ttest_must_fail env GIT_TEST_PROTOCOL_VERSION= git -C client fetch-pack ../server \\\n \t\t$(git -C server rev-parse refs/heads/master^) 2>err &&\n \ttest_i18ngrep \"Server does not allow request for unadvertised object\" err\n '\ndiff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh\nindex 37e8e80893..4bfbb79654 100755\n--- a/t/t5516-fetch-push.sh\n+++ b/t/t5516-fetch-push.sh\n@@ -1147,8 +1147,12 @@ test_expect_success 'fetch exact SHA1' '\n \t\tgit prune &&\n \t\ttest_must_fail git cat-file -t $the_commit &&\n \n+\t\t# Some protocol versions (e.g. 2) support fetching\n+\t\t# unadvertised objects, so restrict this test to v0.\n+\n \t\t# fetching the hidden object should fail by default\n-\t\ttest_must_fail git fetch -v ../testrepo $the_commit:refs/heads/copy 2>err &&\n+\t\ttest_must_fail env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\t\tgit fetch -v ../testrepo $the_commit:refs/heads/copy 2>err &&\n \t\ttest_i18ngrep \"Server does not allow request for unadvertised object\" err &&\n \t\ttest_must_fail git rev-parse --verify refs/heads/copy &&\n \n@@ -1204,7 +1208,10 @@ do\n \t\tmk_empty shallow &&\n \t\t(\n \t\t\tcd shallow &&\n-\t\t\ttest_must_fail git fetch --depth=1 ../testrepo/.git $SHA1 &&\n+\t\t\t# Some protocol versions (e.g. 2) support fetching\n+\t\t\t# unadvertised objects, so restrict this test to v0.\n+\t\t\ttest_must_fail env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\t\t\tgit fetch --depth=1 ../testrepo/.git $SHA1 &&\n \t\t\tgit --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&\n \t\t\tgit fetch --depth=1 ../testrepo/.git $SHA1 &&\n \t\t\tgit cat-file commit $SHA1\n@@ -1232,15 +1239,20 @@ do\n \t\tmk_empty shallow &&\n \t\t(\n \t\t\tcd shallow &&\n-\t\t\ttest_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_3 &&\n-\t\t\ttest_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_1 &&\n+\t\t\t# Some protocol versions (e.g. 2) support fetching\n+\t\t\t# unadvertised objects, so restrict this test to v0.\n+\t\t\ttest_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\t\t\tgit fetch ../testrepo/.git $SHA1_3 &&\n+\t\t\ttest_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\t\t\tgit fetch ../testrepo/.git $SHA1_1 &&\n \t\t\tgit --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true &&\n \t\t\tgit fetch ../testrepo/.git $SHA1_1 &&\n \t\t\tgit cat-file commit $SHA1_1 &&\n \t\t\ttest_must_fail git cat-file commit $SHA1_2 &&\n \t\t\tgit fetch ../testrepo/.git $SHA1_2 &&\n \t\t\tgit cat-file commit $SHA1_2 &&\n-\t\t\ttest_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_3\n+\t\t\ttest_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\t\t\tgit fetch ../testrepo/.git $SHA1_3\n \t\t)\n \t'\n done\ndiff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\nindex a852684e16..f02ae3b797 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -307,7 +307,10 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' '\n \n \tgit init --bare test_reachable.git &&\n \tgit -C test_reachable.git remote add origin \"$HTTPD_URL/smart/repo.git\" &&\n-\ttest_must_fail git -C test_reachable.git fetch origin \"$(git rev-parse HEAD)\"\n+\t# Some protocol versions (e.g. 2) support fetching\n+\t# unadvertised objects, so restrict this test to v0.\n+\ttest_must_fail env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\tgit -C test_reachable.git fetch origin \"$(git rev-parse HEAD)\"\n '\n \n test_expect_success 'test allowanysha1inwant with unreachable' '\n@@ -326,7 +329,10 @@ test_expect_success 'test allowanysha1inwant with unreachable' '\n \n \tgit init --bare test_reachable.git &&\n \tgit -C test_reachable.git remote add origin \"$HTTPD_URL/smart/repo.git\" &&\n-\ttest_must_fail git -C test_reachable.git fetch origin \"$(git rev-parse HEAD)\" &&\n+\t# Some protocol versions (e.g. 2) support fetching\n+\t# unadvertised objects, so restrict this test to v0.\n+\ttest_must_fail env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\tgit -C test_reachable.git fetch origin \"$(git rev-parse HEAD)\" &&\n \n \tgit -C \"$server\" config uploadpack.allowanysha1inwant 1 &&\n \tgit -C test_reachable.git fetch origin \"$(git rev-parse HEAD)\"\ndiff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh\nindex e87164aa8f..c973278300 100755\n--- a/t/t7406-submodule-update.sh\n+++ b/t/t7406-submodule-update.sh\n@@ -943,7 +943,10 @@ test_expect_success 'submodule update clone shallow submodule outside of depth'\n \t\tcd super3 &&\n \t\tsed -e \"s#url = ../#url = file://$pwd/#\" <.gitmodules >.gitmodules.tmp &&\n \t\tmv -f .gitmodules.tmp .gitmodules &&\n-\t\ttest_must_fail git submodule update --init --depth=1 2>actual &&\n+\t\t# Some protocol versions (e.g. 2) support fetching\n+\t\t# unadvertised objects, so restrict this test to v0.\n+\t\ttest_must_fail env GIT_TEST_PROTOCOL_VERSION= \\\n+\t\t\tgit submodule update --init --depth=1 2>actual &&\n \t\ttest_i18ngrep \"Direct fetching of that commit failed.\" actual &&\n \t\tgit -C ../submodule config uploadpack.allowReachableSHA1InWant true &&\n \t\tgit submodule update --init --depth=1 >actual &&\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370148","messageId":"9aaabdac523b22d781571516402fa63a2e81a0e9.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 5/8] t5512: compensate for v0 only sending HEAD symrefs","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:10Z","receivedAt":"2019-02-25T21:54:36Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"Protocol v2 supports sending non-HEAD symrefs, but this is not true of\nprotocol v0. Some tests expect protocol v0 behavior, so fix them to use\nprotocol v0.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5512-ls-remote.sh | 18 +++++++++++++-----\n 1 file changed, 13 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh\nindex ced15ae122..e3c4a48c85 100755\n--- a/t/t5512-ls-remote.sh\n+++ b/t/t5512-ls-remote.sh\n@@ -223,7 +223,9 @@ test_expect_success 'ls-remote --symref' '\n \t$(git rev-parse refs/tags/mark1.10)\trefs/tags/mark1.10\n \t$(git rev-parse refs/tags/mark1.2)\trefs/tags/mark1.2\n \tEOF\n-\tgit ls-remote --symref >actual &&\n+\t# Protocol v2 supports sending symrefs for refs other than HEAD, so use\n+\t# protocol v0 here.\n+\tGIT_TEST_PROTOCOL_VERSION= git ls-remote --symref >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -232,7 +234,9 @@ test_expect_success 'ls-remote with filtered symref (refname)' '\n \tref: refs/heads/master\tHEAD\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\tHEAD\n \tEOF\n-\tgit ls-remote --symref . HEAD >actual &&\n+\t# Protocol v2 supports sending symrefs for refs other than HEAD, so use\n+\t# protocol v0 here.\n+\tGIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . HEAD >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -243,7 +247,9 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/heads/foo\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/heads/master\n \tEOF\n-\tgit ls-remote --symref --heads . >actual &&\n+\t# Protocol v2 supports sending symrefs for refs other than HEAD, so use\n+\t# protocol v0 here.\n+\tGIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual &&\n \ttest_cmp expect actual\n '\n \n@@ -252,9 +258,11 @@ test_expect_success 'ls-remote --symref omits filtered-out matches' '\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/heads/foo\n \t1bd44cb9d13204b0fe1958db0082f5028a16eb3a\trefs/heads/master\n \tEOF\n-\tgit ls-remote --symref --heads . >actual &&\n+\t# Protocol v2 supports sending symrefs for refs other than HEAD, so use\n+\t# protocol v0 here.\n+\tGIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual &&\n \ttest_cmp expect actual &&\n-\tgit ls-remote --symref . \"refs/heads/*\" >actual &&\n+\tGIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . \"refs/heads/*\" >actual &&\n \ttest_cmp expect actual\n '\n \n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370149","messageId":"6c29e64bc3b081b0974de3e0d5fb7b926b272eaa.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 6/8] t5700: only run with protocol version 1","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:11Z","receivedAt":"2019-02-25T21:54:36Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"Signed-off-by: Jonathan Tan <jonathantanmy@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5700-protocol-v1.sh | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh\nindex ba86a44eb1..d5ed196bfd 100755\n--- a/t/t5700-protocol-v1.sh\n+++ b/t/t5700-protocol-v1.sh\n@@ -4,6 +4,9 @@ test_description='test git wire-protocol transition'\n \n TEST_NO_CREATE_REPO=1\n \n+# This is a protocol-specific test.\n+GIT_TEST_PROTOCOL_VERSION=\n+\n . ./test-lib.sh\n \n # Test protocol v1 with 'git://' transport\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370150","messageId":"d4638e94183fb5d6b5e84c60196c1f3866128295.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 7/8] tests: fix protocol version for overspecifications","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:12Z","receivedAt":"2019-02-25T21:54:39Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"These tests are also marked with a NEEDSWORK comment.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5515-fetch-merge-logic.sh  |  4 ++++\n t/t5539-fetch-http-shallow.sh |  5 ++++-\n t/t5541-http-push-smart.sh    | 14 ++++++++++++--\n t/t5551-http-fetch-smart.sh   | 34 ++++++++++++++++++++++++++--------\n 4 files changed, 46 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh\nindex 36b0dbc01c..e55d8474ef 100755\n--- a/t/t5515-fetch-merge-logic.sh\n+++ b/t/t5515-fetch-merge-logic.sh\n@@ -6,6 +6,10 @@\n \n test_description='Merge logic in fetch'\n \n+# NEEDSWORK: If the overspecification of the expected result is reduced, we\n+# might be able to run this test in all protocol versions.\n+GIT_TEST_PROTOCOL_VERSION=\n+\n . ./test-lib.sh\n \n LF='\ndiff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh\nindex 5fbf67c446..cdb687b93a 100755\n--- a/t/t5539-fetch-http-shallow.sh\n+++ b/t/t5539-fetch-http-shallow.sh\n@@ -67,7 +67,10 @@ test_expect_success 'no shallow lines after receiving ACK ready' '\n \t\tcd clone &&\n \t\tgit checkout --orphan newnew &&\n \t\ttest_commit new-too &&\n-\t\tGIT_TRACE_PACKET=\"$TRASH_DIRECTORY/trace\" git fetch --depth=2 &&\n+\t\t# NEEDSWORK: If the overspecification of the expected result is reduced, we\n+\t\t# might be able to run this test in all protocol versions.\n+\t\tGIT_TRACE_PACKET=\"$TRASH_DIRECTORY/trace\" GIT_TEST_PROTOCOL_VERSION= \\\n+\t\t\tgit fetch --depth=2 &&\n \t\tgrep \"fetch-pack< ACK .* ready\" ../trace &&\n \t\t! grep \"fetch-pack> done\" ../trace\n \t)\ndiff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh\nindex 5475afc052..0e3055ab98 100755\n--- a/t/t5541-http-push-smart.sh\n+++ b/t/t5541-http-push-smart.sh\n@@ -47,7 +47,12 @@ test_expect_success 'no empty path components' '\n \tcd \"$ROOT_PATH\" &&\n \tgit clone $HTTPD_URL/smart/test_repo.git/ test_repo_clone &&\n \n-\tcheck_access_log exp\n+\t# NEEDSWORK: If the overspecification of the expected result is reduced, we\n+\t# might be able to run this test in all protocol versions.\n+\tif test -z \"$GIT_TEST_PROTOCOL_VERSION\"\n+\tthen\n+\t\tcheck_access_log exp\n+\tfi\n '\n \n test_expect_success 'clone remote repository' '\n@@ -128,7 +133,12 @@ GET  /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200\n POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200\n EOF\n test_expect_success 'used receive-pack service' '\n-\tcheck_access_log exp\n+\t# NEEDSWORK: If the overspecification of the expected result is reduced, we\n+\t# might be able to run this test in all protocol versions.\n+\tif test -z \"$GIT_TEST_PROTOCOL_VERSION\"\n+\tthen\n+\t\tcheck_access_log exp\n+\tfi\n '\n \n test_http_push_nonff \"$HTTPD_DOCUMENT_ROOT_PATH\"/test_repo.git \\\ndiff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh\nindex f02ae3b797..a685d3edb6 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -81,12 +81,18 @@ test_expect_success 'clone http repository' '\n \t\t/^< Content-Length: /d\n \t\t/^< Transfer-Encoding: /d\n \t\" >actual &&\n-\tsed -e \"s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/\" \\\n-\t\t\tactual >actual.smudged &&\n-\ttest_cmp exp actual.smudged &&\n \n-\tgrep \"Accept-Encoding:.*gzip\" actual >actual.gzip &&\n-\ttest_line_count = 2 actual.gzip\n+\t# NEEDSWORK: If the overspecification of the expected result is reduced, we\n+\t# might be able to run this test in all protocol versions.\n+\tif test -z \"$GIT_TEST_PROTOCOL_VERSION\"\n+\tthen\n+\t\tsed -e \"s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/\" \\\n+\t\t\t\tactual >actual.smudged &&\n+\t\ttest_cmp exp actual.smudged &&\n+\n+\t\tgrep \"Accept-Encoding:.*gzip\" actual >actual.gzip &&\n+\t\ttest_line_count = 2 actual.gzip\n+\tfi\n '\n \n test_expect_success 'fetch changes via http' '\n@@ -104,7 +110,13 @@ test_expect_success 'used upload-pack service' '\n \tGET  /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200\n \tPOST /smart/repo.git/git-upload-pack HTTP/1.1 200\n \tEOF\n-\tcheck_access_log exp\n+\n+\t# NEEDSWORK: If the overspecification of the expected result is reduced, we\n+\t# might be able to run this test in all protocol versions.\n+\tif test -z \"$GIT_TEST_PROTOCOL_VERSION\"\n+\tthen\n+\t\tcheck_access_log exp\n+\tfi\n '\n \n test_expect_success 'follow redirects (301)' '\n@@ -216,8 +228,14 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set\n \tgit config http.cookiefile cookies.txt &&\n \tgit config http.savecookies true &&\n \tgit ls-remote $HTTPD_URL/smart_cookies/repo.git master &&\n-\ttail -3 cookies.txt | sort >cookies_tail.txt &&\n-\ttest_cmp expect_cookies.txt cookies_tail.txt\n+\n+\t# NEEDSWORK: If the overspecification of the expected result is reduced, we\n+\t# might be able to run this test in all protocol versions.\n+\tif test -z \"$GIT_TEST_PROTOCOL_VERSION\"\n+\tthen\n+\t\ttail -3 cookies.txt | sort >cookies_tail.txt &&\n+\t\ttest_cmp expect_cookies.txt cookies_tail.txt\n+\tfi\n '\n \n test_expect_success 'transfer.hiderefs works over smart-http' '\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370151","messageId":"629a243c7f53cfb01f7fec060db318f650ad33d3.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 8/8] t5552: compensate for v2 filtering ref adv.","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:13Z","receivedAt":"2019-02-25T21:54:40Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"Protocol v2 filters the ref advertisement, but protocol v0 does not. A\ntest in t5552 uses the ref advertisement, so fix it to use protocol v0.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5552-skipping-fetch-negotiator.sh | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh\nindex 30857b84a8..8a14be51a1 100755\n--- a/t/t5552-skipping-fetch-negotiator.sh\n+++ b/t/t5552-skipping-fetch-negotiator.sh\n@@ -127,7 +127,10 @@ test_expect_success 'use ref advertisement to filter out commits' '\n \t# not need to send any ancestors of \"c3\", but we still need to send \"c3\"\n \t# itself.\n \ttest_config -C client fetch.negotiationalgorithm skipping &&\n-\ttrace_fetch client origin to_fetch &&\n+\n+\t# The ref advertisement itself is filtered when protocol v2 is used, so\n+\t# use v0.\n+\tGIT_TEST_PROTOCOL_VERSION= trace_fetch client origin to_fetch &&\n \thave_sent c5 c4^ c2side &&\n \thave_not_sent c4 c4^^ c4^^^\n '\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"370152","messageId":"8f510c5c78dd5152307e30f8115188ad689b8c57.1551131153.git.jonathantanmy@google.com","threadId":"50590","inReplyTo":"cover.1551131153.git.jonathantanmy@google.com","subject":"[PATCH 4/8] t5503: fix overspecification of trace expectation","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-02-25T21:54:09Z","receivedAt":"2019-02-25T21:54:45Z","isPatch":true,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"In order to extract the wants from a trace, a loop in t5503 currently\nbreaks if \"0000\" is found. This works for protocol v0 and v1, but not\nv2. Instead, teach t5503 to look specifically for the \"want\" string,\nwhich is compatible with all protocols.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n t/t5503-tagfollow.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh\nindex 4ca48f0276..6041a4dd32 100755\n--- a/t/t5503-tagfollow.sh\n+++ b/t/t5503-tagfollow.sh\n@@ -47,7 +47,7 @@ get_needs () {\n \ttest -s \"$1\" &&\n \tperl -alne '\n \t\tnext unless $F[1] eq \"upload-pack<\";\n-\t\tlast if $F[2] eq \"0000\";\n+\t\tnext unless $F[2] eq \"want\";\n \t\tprint $F[2], \" \", $F[3];\n \t' \"$1\"\n }\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"}]}