{"thread":{"id":"50244","subject":"[WIP 0/8] Trying to revive GIT_TEST_PROTOCOL_VERSION","startedAt":"2019-01-16T22:42:23Z","lastAt":"2019-01-17T21:18:43Z","messageCount":12,"participants":["Jonathan Tan","Ævar Arnfjörð Bjarmason","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"366881","messageId":"cover.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":null,"subject":"[WIP 0/8] Trying to revive GIT_TEST_PROTOCOL_VERSION","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:08Z","receivedAt":"2019-01-16T22:42:23Z","isPatch":false,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"Ævar, are you planning to revive GIT_TEST_PROTOCOL_VERSION? I have\nupdated the patchset in light of some new branches that have appeared.\n\nThis is on master merged with:\n - jk/proto-v2-hidden-refs-fix\n - tg/t5570-drop-racy-test\n - js/protocol-advertise-multi\n - jt/upload-pack-deepen-relative-proto-v2\n - jt/fetch-pack-v2\n\nOne notable change I made is that I made this envvar determine the\nminimum version. So, if GIT_TEST_PROTOCOL_VERSION=1 and the test\nexplicitly states v2, v2 is used (but if GIT_TEST_PROTOCOL_VERISON=2,\nall use v2). I think this reduces the number of false negatives, since\nthere are quite a few tests that use v2 specific features, and that are\nalready marked as v2.\n\nI included one genuine bug fix (the last patch) and the rest are either\noverspecifications (which I didn't investigate too deeply) or false\nnegatives. There are still some errors when run with\nGIT_TEST_PROTOCOL_VERSION=2 which I don't think are false negatives -\nI'll continue to look into them.\n\nJonathan Tan (8):\n  tests: define GIT_TEST_PROTOCOL_VERSION\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  remote-curl: in v2, fill credentials if needed\n\n protocol.c                           | 17 ++++++++--\n remote-curl.c                        |  9 +++++-\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/t5700-protocol-v1.sh               |  3 ++\n t/t7406-submodule-update.sh          |  5 ++-\n 15 files changed, 128 insertions(+), 32 deletions(-)\n\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"366882","messageId":"241afc6b556334fe212147e94167e3f23d4e21f5.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 1/8] tests: define GIT_TEST_PROTOCOL_VERSION","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:09Z","receivedAt":"2019-01-16T22:42:26Z","isPatch":false,"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, set to 0, or set to 1. Some tests fail when\nGIT_TEST_PROTOCOL_VERSION is set to 2, but this will be dealt with in\nsubsequent patches.\n\nThis is based on work by Ævar Arnfjörð Bjarmason.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.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 5664bd7a05..c7a735bfa2 100644\n--- a/protocol.c\n+++ b/protocol.c\n@@ -42,6 +42,10 @@ static const char *format_protocol_version(enum protocol_version version)\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@@ -49,10 +53,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 && strlen(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 void register_allowed_protocol_version(enum protocol_version version)\ndiff --git a/t/README b/t/README\nindex 28711cc508..fd7f29cbe1 100644\n--- a/t/README\n+++ b/t/README\n@@ -311,6 +311,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 a60dd907bd..8f620e0a35 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -44,7 +44,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":"366883","messageId":"0484d242fa689ad0fd0d342216d9e729ca35ba24.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 2/8] tests: always test fetch of unreachable with v0","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:10Z","receivedAt":"2019-01-16T22:42:29Z","isPatch":false,"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>\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 8f620e0a35..d2661eb338 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -308,7 +308,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@@ -327,7 +330,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":"366884","messageId":"0820b3411cf217fd3fe0ecf40edafd7adec4851e.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 3/8] t5503: fix overspecification of trace expectation","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:11Z","receivedAt":"2019-01-16T22:42:31Z","isPatch":false,"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>\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"},{"id":"366885","messageId":"db88da6ca2e684f157a1f6ce3498f13d4bee4ab6.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 4/8] t5512: compensate for v0 only sending HEAD symrefs","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:12Z","receivedAt":"2019-01-16T22:42:34Z","isPatch":false,"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>\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 ca69636fd5..d3bac6f2ee 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":"366886","messageId":"a9a1fb7958e9b4269ca3057f0b4bbe4565d56e8e.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 5/8] t5700: only run with protocol version 1","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:13Z","receivedAt":"2019-01-16T22:42:37Z","isPatch":false,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"Signed-off-by: Jonathan Tan <jonathantanmy@google.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 2e56c79233..9857bd0ecb 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":"366887","messageId":"bc2ce6e43599af66561c610a4132e05eeaa0ecbe.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 6/8] tests: fix protocol version for overspecifications","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:14Z","receivedAt":"2019-01-16T22:42:40Z","isPatch":false,"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>\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 d2661eb338..e8ed185b33 100755\n--- a/t/t5551-http-fetch-smart.sh\n+++ b/t/t5551-http-fetch-smart.sh\n@@ -82,12 +82,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@@ -105,7 +111,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@@ -217,8 +229,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":"366888","messageId":"b5c7322c03d6c26aadd5242eafab880ceac4db9b.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 7/8] t5552: compensate for v2 filtering ref adv.","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:15Z","receivedAt":"2019-01-16T22:42:42Z","isPatch":false,"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>\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":"366889","messageId":"f19beb723416df54e15cecc4db0d54408abdf6e7.1547677183.git.jonathantanmy@google.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"[WIP 8/8] remote-curl: in v2, fill credentials if needed","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-16T22:42:16Z","receivedAt":"2019-01-16T22:42:46Z","isPatch":false,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"In post_rpc(), remote-curl calls credential_fill() if HTTP_REAUTH is\nreturned, but this is not true in proxy_request(). Do this in\nproxy_request() too.\n\nWhen t5551 is run using GIT_TEST_PROTOCOL_VERSION=2, one of the tests\nthat used to fail now pass.\n\nSigned-off-by: Jonathan Tan <jonathantanmy@google.com>\n---\n remote-curl.c | 9 ++++++++-\n 1 file changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/remote-curl.c b/remote-curl.c\nindex 0d8fe19cc7..cd6749032a 100644\n--- a/remote-curl.c\n+++ b/remote-curl.c\n@@ -1264,7 +1264,9 @@ static size_t proxy_out(char *buffer, size_t eltsize,\n static int proxy_request(struct proxy_state *p)\n {\n \tstruct active_request_slot *slot;\n+\tint err;\n \n+retry:\n \tslot = get_active_slot();\n \n \tcurl_easy_setopt(slot->curl, CURLOPT_ENCODING, \"\");\n@@ -1281,7 +1283,12 @@ static int proxy_request(struct proxy_state *p)\n \tcurl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, proxy_out);\n \tcurl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, p);\n \n-\tif (run_slot(slot, NULL) != HTTP_OK)\n+\terr = run_slot(slot, NULL);\n+\tif (err == HTTP_REAUTH) {\n+\t\tcredential_fill(&http_auth);\n+\t\tgoto retry;\n+\t}\n+\tif (err != HTTP_OK)\n \t\treturn -1;\n \n \treturn 0;\n-- \n2.19.0.271.gfe8321ec05.dirty\n\n"},{"id":"366904","messageId":"87o98f4ol6.fsf@evledraar.gmail.com","threadId":"50244","inReplyTo":"cover.1547677183.git.jonathantanmy@google.com","subject":"Re: [WIP 0/8] Trying to revive GIT_TEST_PROTOCOL_VERSION","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2019-01-17T09:31:49Z","receivedAt":"2019-01-17T09:31:55Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"\nOn Wed, Jan 16 2019, Jonathan Tan wrote:\n\n> Ævar, are you planning to revive GIT_TEST_PROTOCOL_VERSION? I have\n> updated the patchset in light of some new branches that have appeared.\n>\n> This is on master merged with:\n>  - jk/proto-v2-hidden-refs-fix\n>  - tg/t5570-drop-racy-test\n>  - js/protocol-advertise-multi\n>  - jt/upload-pack-deepen-relative-proto-v2\n>  - jt/fetch-pack-v2\n\nI'm happy to have you pick that up as you've done here, especially since\nyou're actually working on v2 and I'm not, so you can more easily know\nwhat it conflicts with etc. I just wanted to have it in one way or\nanother, i.e. be able to deploy v2 and assert that \"next + custom\npatches\" doesn't break something for v2.\n\nI think [CC: Junio] that we shouldn't be concerned about an addition of\nGIT_TEST_PROTOCOL_VERSION patches in any form breaking the test suite\nunder GIT_TEST_PROTOCOL_VERSION=2, and just be concerned about the\ndefault GIT_TEST_PROTOCOL_VERSION= case. I.e. if we have v2 patches\nin-flight that break things no big deal, we can always circle back and\nfix those things or annotate the tests.\n"},{"id":"367009","messageId":"20190117183727.260298-1-jonathantanmy@google.com","threadId":"50244","inReplyTo":"87o98f4ol6.fsf@evledraar.gmail.com","subject":"Re: [WIP 0/8] Trying to revive GIT_TEST_PROTOCOL_VERSION","fromName":"Jonathan Tan","fromEmail":"jonathantanmy@google.com","sentAt":"2019-01-17T18:37:27Z","receivedAt":"2019-01-17T18:37:34Z","isPatch":false,"sender":{"key":"jonathantanmy@fastmail.com","avatar":null},"body":"> I'm happy to have you pick that up as you've done here, especially since\n> you're actually working on v2 and I'm not, so you can more easily know\n> what it conflicts with etc. I just wanted to have it in one way or\n> another, i.e. be able to deploy v2 and assert that \"next + custom\n> patches\" doesn't break something for v2.\n> \n> I think [CC: Junio] that we shouldn't be concerned about an addition of\n> GIT_TEST_PROTOCOL_VERSION patches in any form breaking the test suite\n> under GIT_TEST_PROTOCOL_VERSION=2, and just be concerned about the\n> default GIT_TEST_PROTOCOL_VERSION= case. I.e. if we have v2 patches\n> in-flight that break things no big deal, we can always circle back and\n> fix those things or annotate the tests.\n\nThat sounds good to me. My main concern is that this will end up being\ndead code (if we have too many tests that fail with\nGIT_TEST_PROTOCOL_VERSION=2 and no one bothers with it anymore), but I\ndon't think that will happen - in this patch set, I have eliminated a\nlot of false failures and strove to give reasons for the\nGIT_TEST_PROTOCOL_VERSION= annotations, and I think there's interest\n(well, at least from me) in investigating the remaining apparent bugs.\n"},{"id":"367032","messageId":"xmqqfttrm18w.fsf@gitster-ct.c.googlers.com","threadId":"50244","inReplyTo":"20190117183727.260298-1-jonathantanmy@google.com","subject":"Re: [WIP 0/8] Trying to revive GIT_TEST_PROTOCOL_VERSION","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-01-17T21:18:39Z","receivedAt":"2019-01-17T21:18:43Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Tan <jonathantanmy@google.com> writes:\n\n>> I'm happy to have you pick that up as you've done here, especially since\n>> you're actually working on v2 and I'm not, so you can more easily know\n>> what it conflicts with etc. I just wanted to have it in one way or\n>> another, i.e. be able to deploy v2 and assert that \"next + custom\n>> patches\" doesn't break something for v2.\n>> \n>> I think [CC: Junio] that we shouldn't be concerned about an addition of\n>> GIT_TEST_PROTOCOL_VERSION patches in any form breaking the test suite\n>> under GIT_TEST_PROTOCOL_VERSION=2, and just be concerned about the\n>> default GIT_TEST_PROTOCOL_VERSION= case. I.e. if we have v2 patches\n>> in-flight that break things no big deal, we can always circle back and\n>> fix those things or annotate the tests.\n>\n> That sounds good to me. My main concern is that this will end up being\n> dead code (if we have too many tests that fail with\n> GIT_TEST_PROTOCOL_VERSION=2 and no one bothers with it anymore), but I\n> don't think that will happen - in this patch set, I have eliminated a\n> lot of false failures and strove to give reasons for the\n> GIT_TEST_PROTOCOL_VERSION= annotations, and I think there's interest\n> (well, at least from me) in investigating the remaining apparent bugs.\n\nYup, sounds good to me, too.\n"}]}