From patchwork Wed Feb 6 00:21:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10798703 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 21F7813B4 for ; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E9892C60A for ; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3FEF2C624; Wed, 6 Feb 2019 00:21:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D23A42C60A for ; Wed, 6 Feb 2019 00:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726806AbfBFAVa (ORCPT ); Tue, 5 Feb 2019 19:21:30 -0500 Received: from mail-it1-f201.google.com ([209.85.166.201]:52503 "EHLO mail-it1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbfBFAVa (ORCPT ); Tue, 5 Feb 2019 19:21:30 -0500 Received: by mail-it1-f201.google.com with SMTP id o205so1526243itc.2 for ; Tue, 05 Feb 2019 16:21:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc:content-transfer-encoding; bh=bzMSmmNf61aws+11xjYEzZh+7adoDsl8yuJy02exA1U=; b=GuPsFkmlCcoXdHtVyvhQwjCDPeYVsuSwbnBs0jymO856BXWCNtYCXoyda1q0hH4fgH ke4z5dYbG5RQrFJOESGkG/2j/CeUPk0CFTHmsbQ9au+VWVDjOTlIT415PFw9tMP2Qrpd H6p3fZEljRzlS3JaUrV9TCIy5IpP5H6CjlETQeh3v1f13oPGBYOE+xV+3md4pXFJ+Uzy lziIvrNWVPx0NOjcDalLaezCpxLPM7eqyIuB5POth77jY8mf3YIQlLs+mpJBmY9HsCJ3 T74XNoTTTSgGaFCOcKvVMx5RZU3AfXG8HE1LLKVyMK4WDZVPQg6Z+a73Uq+RGn/Ia6J1 Yecw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc:content-transfer-encoding; bh=bzMSmmNf61aws+11xjYEzZh+7adoDsl8yuJy02exA1U=; b=OJU12QMzWj3TA9wJGllPvc1JCPM05rkD0LYVJbLKJtpiJLXStcjmYboZktAT67hgmd SQrpt8YUe68Sp6OZ+ur/m9dNwuwIgnukKj0we5jUYlUco2BQG0sBUOCaeOcnqqJoofbJ a0fLPjRhi7t6Agrs0+a/BVCnDHW0Wf7eEWaWCLSks7VajZSsPzelBvERQpSyIJGpYlgO Vjf34jYeGVZZTsEH0yiZ5mfv4Fkt2pmIx39qNm5C3dHiGL97UuSbggRaBwg6MOe7RTac 7N/zSU0OtW43ulXTbrJTVwkjRrkSLhVRXM/iQPXdHQytU7pHVkSeKiuWvP0Qa0Qm/j+g 3o/w== X-Gm-Message-State: AHQUAuYw4gt53AAibzAPh606A2YCopF2NWbaiAv06fx5Y+TdF3ihnHXq tDIhT3k8iZKZPMk09t/7qnDjb2a38GPpDu1GVS6iFKe1kjdt12psl5zLyttUwxT52dlpjY4LaQI FjaiB2OnfO4wQMJWjlQenX/YrOxa6Ry5H3SGI0UMsaj+xQszx0ll7sw5si6zeY77CUrYf2qk8fw 4T X-Google-Smtp-Source: AHgI3IYU2dPMVRBtY7vin45JxU/UD50IMNEfAM4Sxnz7ZGNC4ATbBMAxvjYzg3iUvrwPBa7A3UmgKiNMtrA5JmhhOeMe X-Received: by 2002:a24:1c5:: with SMTP id 188mr935202itk.12.1549412489061; Tue, 05 Feb 2019 16:21:29 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:15 -0800 In-Reply-To: Message-Id: <6e0c6aa9a71d4192591ed406735684cd15a0e3b9.1549411880.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 1/8] tests: define GIT_TEST_PROTOCOL_VERSION From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Define a GIT_TEST_PROTOCOL_VERSION environment variable meant to be used from tests. When set, this ensures protocol.version is at least the given value, allowing the entire test suite to be run as if this configuration is in place for all repositories. As of this patch, all tests pass whether GIT_TEST_PROTOCOL_VERSION is unset, set to 0, or set to 1. Some tests fail when GIT_TEST_PROTOCOL_VERSION is set to 2, but this will be dealt with in subsequent patches. This is based on work by Ævar Arnfjörð Bjarmason. Signed-off-by: Jonathan Tan --- protocol.c | 17 +++++++++++++++-- t/README | 3 +++ t/t5400-send-pack.sh | 2 +- t/t5551-http-fetch-smart.sh | 3 ++- 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/protocol.c b/protocol.c index 5664bd7a05..c7a735bfa2 100644 --- a/protocol.c +++ b/protocol.c @@ -42,6 +42,10 @@ static const char *format_protocol_version(enum protocol_version version) enum protocol_version get_protocol_version_config(void) { const char *value; + enum protocol_version retval = protocol_v0; + const char *git_test_k = "GIT_TEST_PROTOCOL_VERSION"; + const char *git_test_v = getenv(git_test_k); + if (!git_config_get_string_const("protocol.version", &value)) { enum protocol_version version = parse_protocol_version(value); @@ -49,10 +53,19 @@ enum protocol_version get_protocol_version_config(void) die("unknown value for config 'protocol.version': %s", value); - return version; + retval = version; + } + + if (git_test_v && strlen(git_test_v)) { + enum protocol_version env = parse_protocol_version(git_test_v); + + if (env == protocol_unknown_version) + die("unknown value for %s: %s", git_test_k, git_test_v); + if (retval < env) + retval = env; } - return protocol_v0; + return retval; } void register_allowed_protocol_version(enum protocol_version version) diff --git a/t/README b/t/README index 25864ec883..21e941eb94 100644 --- a/t/README +++ b/t/README @@ -327,6 +327,9 @@ marked strings" in po/README for details. GIT_TEST_SPLIT_INDEX= forces split-index mode on the whole test suite. Accept any boolean values that are accepted by git-config. +GIT_TEST_PROTOCOL_VERSION=, when set, overrides the +'protocol.version' setting to n if it is less than n. + GIT_TEST_FULL_IN_PACK_ARRAY= exercises the uncommon pack-objects code path where there are more than 1024 packs even if the actual number of packs in repository is below this limit. Accept diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index f1932ea431..571d620aed 100755 --- a/t/t5400-send-pack.sh +++ b/t/t5400-send-pack.sh @@ -288,7 +288,7 @@ test_expect_success 'receive-pack de-dupes .have lines' ' $shared .have EOF - GIT_TRACE_PACKET=$(pwd)/trace \ + GIT_TRACE_PACKET=$(pwd)/trace GIT_TEST_PROTOCOL_VERSION= \ git push \ --receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \ fork HEAD:foo && diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index a60dd907bd..8f620e0a35 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -44,7 +44,8 @@ test_expect_success 'clone http repository' ' < Cache-Control: no-cache, max-age=0, must-revalidate < Content-Type: application/x-git-upload-pack-result EOF - GIT_TRACE_CURL=true git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && + GIT_TRACE_CURL=true GIT_TEST_PROTOCOL_VERSION= \ + git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && test_cmp file clone/file && tr '\''\015'\'' Q X-Patchwork-Id: 10798705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 454A7922 for ; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34BC22C60A for ; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 296612C621; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13C8E2C61E for ; Wed, 6 Feb 2019 00:21:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726852AbfBFAVd (ORCPT ); Tue, 5 Feb 2019 19:21:33 -0500 Received: from mail-it1-f202.google.com ([209.85.166.202]:54740 "EHLO mail-it1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbfBFAVc (ORCPT ); Tue, 5 Feb 2019 19:21:32 -0500 Received: by mail-it1-f202.google.com with SMTP id v3so1508743itf.4 for ; Tue, 05 Feb 2019 16:21:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=CkLq877M7gqmsyY2awwRgNsUA7LY0Mw06Lhm4BRXyzI=; b=EvklAtIOkp6giSNwSshJqMYhPUBWS5s2BRsz88LNXoyk1otroUCUI6f+as9TuIo+nW WYnjsO8ZTXzFxUIku8lepwDGNx9FUg8zmqTAhmWlksGgg/1n2JRlOj9Bu8pt+wr8M+Xx 7JBKqWIRruTKpedSpTTiENupEht9Ph1brIBZLAaU4ncQg2gBxRCb4SX2Z0z6TX3QKiu4 pEZU87vUX/4EL3yGRpgmtf6iRTTvCWRva/wXaFvkju5JJbD/Y6peCCsOE4FL0TpQOrEw llQ8xa2Zm9aBhKDiaSAUCrEeQq1s0d6BN1pGWAa8RR0uyfCyLMWfYBuhinB0Xq9fp/sv hL6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=CkLq877M7gqmsyY2awwRgNsUA7LY0Mw06Lhm4BRXyzI=; b=gTyjIXuE4LX+nfgVcBv+pTZU56nN1SBmhYg9RvcWHWJMBlcM68Gwm0UiyFAzmfEtbT FxBLMNgF7yR/xIeMq5fuuSMnhdtqax0BKcmpm+aWuZuILqlbyRcWmrRtRHmbNDUlBvqB dxSvXlxQpwUDe0mvkY04nn7IuAVNAoPl/m2Fk5t9AQObdrxOKiwrupClQYtfFSBCbOjT WvJBCatr4AGp+DaBKGdoGCcmz87crV1Ia+j+1LuM7ivRBEC1NnIVYBD8Cso8zZ4x+rbN feMynikzjYhs4BcbWLGfskqvYUya6t6f4FH4L7M5FX5lY9w/a2aHg5xf2Jw80yQuc9tS XfyA== X-Gm-Message-State: AHQUAuZggtD/dARykLnB3iheHrVLPUwlqzfgoUxGsLw9zIKKvCdsPhJ0 M0H9TzAtdBA4sInK58QTUsarhw1k0wg49Sq842ehNuch6EwB2k8Astm7EZabZc61ogWJ0sy0rjj rRUO+mS84n4BYaQld+3Ykbm1Bjb8ctdNDYQVnNzodbvET/VDCO3sGJM42JTqzbzzAvHYsONZ0hw ys X-Google-Smtp-Source: AHgI3IaZu/m1ijmy9sD5+H6X8LXfJSGbvZTVFLw6qmaRrgl7bqxTdizN9VMKw+Yk2g8UdrymfXhvbzr+i1dpOhDsi2oP X-Received: by 2002:a24:254b:: with SMTP id g72mr309894itg.19.1549412491477; Tue, 05 Feb 2019 16:21:31 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:16 -0800 In-Reply-To: Message-Id: <9b9061985202ec022cc562637d7f62ea599e7d8c.1549411880.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 2/8] tests: always test fetch of unreachable with v0 From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Some tests check that fetching an unreachable object fails, but protocol v2 allows such fetches. Unset GIT_TEST_PROTOCOL_VERSION so that these tests are always run using protocol v0. Signed-off-by: Jonathan Tan --- t/t5500-fetch-pack.sh | 4 +++- t/t5516-fetch-push.sh | 22 +++++++++++++++++----- t/t5551-http-fetch-smart.sh | 10 ++++++++-- t/t7406-submodule-update.sh | 5 ++++- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 49c540b1e1..0ef4d6f20c 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -636,7 +636,9 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a test_commit -C server 6 && git init client && - test_must_fail git -C client fetch-pack ../server \ + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. + test_must_fail env GIT_TEST_PROTOCOL_VERSION= git -C client fetch-pack ../server \ $(git -C server rev-parse refs/heads/master^) 2>err && test_i18ngrep "Server does not allow request for unadvertised object" err ' diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 37e8e80893..4bfbb79654 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1147,8 +1147,12 @@ test_expect_success 'fetch exact SHA1' ' git prune && test_must_fail git cat-file -t $the_commit && + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. + # fetching the hidden object should fail by default - test_must_fail git fetch -v ../testrepo $the_commit:refs/heads/copy 2>err && + test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + git fetch -v ../testrepo $the_commit:refs/heads/copy 2>err && test_i18ngrep "Server does not allow request for unadvertised object" err && test_must_fail git rev-parse --verify refs/heads/copy && @@ -1204,7 +1208,10 @@ do mk_empty shallow && ( cd shallow && - test_must_fail git fetch --depth=1 ../testrepo/.git $SHA1 && + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. + test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + git fetch --depth=1 ../testrepo/.git $SHA1 && git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true && git fetch --depth=1 ../testrepo/.git $SHA1 && git cat-file commit $SHA1 @@ -1232,15 +1239,20 @@ do mk_empty shallow && ( cd shallow && - test_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_3 && - test_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_1 && + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. + test_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \ + git fetch ../testrepo/.git $SHA1_3 && + test_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \ + git fetch ../testrepo/.git $SHA1_1 && git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true && git fetch ../testrepo/.git $SHA1_1 && git cat-file commit $SHA1_1 && test_must_fail git cat-file commit $SHA1_2 && git fetch ../testrepo/.git $SHA1_2 && git cat-file commit $SHA1_2 && - test_must_fail ok=sigpipe git fetch ../testrepo/.git $SHA1_3 + test_must_fail ok=sigpipe env GIT_TEST_PROTOCOL_VERSION= \ + git fetch ../testrepo/.git $SHA1_3 ) ' done diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index 8f620e0a35..d2661eb338 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -308,7 +308,10 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' ' git init --bare test_reachable.git && git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" && - test_must_fail git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. + test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" ' test_expect_success 'test allowanysha1inwant with unreachable' ' @@ -327,7 +330,10 @@ test_expect_success 'test allowanysha1inwant with unreachable' ' git init --bare test_reachable.git && git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" && - test_must_fail git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" && + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. + test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" && git -C "$server" config uploadpack.allowanysha1inwant 1 && git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index e87164aa8f..c973278300 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -943,7 +943,10 @@ test_expect_success 'submodule update clone shallow submodule outside of depth' cd super3 && sed -e "s#url = ../#url = file://$pwd/#" <.gitmodules >.gitmodules.tmp && mv -f .gitmodules.tmp .gitmodules && - test_must_fail git submodule update --init --depth=1 2>actual && + # Some protocol versions (e.g. 2) support fetching + # unadvertised objects, so restrict this test to v0. + test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + git submodule update --init --depth=1 2>actual && test_i18ngrep "Direct fetching of that commit failed." actual && git -C ../submodule config uploadpack.allowReachableSHA1InWant true && git submodule update --init --depth=1 >actual && From patchwork Wed Feb 6 00:21:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10798707 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BB4DA186D for ; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC5F32C60A for ; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0FA12C621; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EA142C60A for ; Wed, 6 Feb 2019 00:21:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726979AbfBFAVf (ORCPT ); Tue, 5 Feb 2019 19:21:35 -0500 Received: from mail-qk1-f201.google.com ([209.85.222.201]:55548 "EHLO mail-qk1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbfBFAVf (ORCPT ); Tue, 5 Feb 2019 19:21:35 -0500 Received: by mail-qk1-f201.google.com with SMTP id w28so4795429qkj.22 for ; Tue, 05 Feb 2019 16:21:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=v5ncvF0/tMxmsjbrRb4qeq3WPVkNRAUgsE/fIVkGHIM=; b=WDLwR7G0XRITznEyAprspJubR6apSRuohq2yzw1iRf3OaCA2aERVW5dTSA2PhY9WKX RBGieGL5SuGMfbrH8+wabSmyh9nVbM4/rpFsah7xBNgQR2oxxjxQvke7pK+HYMMXnoR3 2sBciYzvecRrTnUkXVDbb5FDjvOT9lOYhndrhpkiik7Pd9KRsF6AtGoioYtxj6bDWT5W SMj5k3X/HI5m2uOa6jjZDdwWDUhKJewVBI7RECV9s4oCNvoVRyPhEvEeE9qG+T/aSi47 uELBqTXKTYezvkiU9iPnhKpUEBPrgOEXzuxvqXqAY3QrcfPOXFfo7RLQus+k0vlqWN/W Yg/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=v5ncvF0/tMxmsjbrRb4qeq3WPVkNRAUgsE/fIVkGHIM=; b=cnV/iy2G1TgRS28J2Gx2g796Ab/6Gy4Q1cIk3SF1imlvRsPDi7iaV6GCZvFjToHiel 5t08cdgzZmYXnKJ7saAEYAvsCzUaYvUHjBX9xxaGLSJ9P/ghvZigev3gQhFxkEDPT6pX OgnrDRRyEA9ssNe3WCATWZi0X04rWiGkpBzVmPbV5Df9Lxj+i3F55of0U6jkH2LqGE5d +6PFYxK9rqtxlTygBEXMVXE8iSP1yzvrjvgH9LL3eVG64v9CnaY+mMBrhtl7wj5wbUPT pJ90M5R/UYpBCl3YN0yUI9z1xmjyJkxfqJqKWdJZyAQ38EPkIfKap21sHjI2XvP5VGn0 lFZw== X-Gm-Message-State: AHQUAuYMjt8yCGqy7qQRho7Pvx0dr9XGGUAwIbrZF7zHRfPfClKvSARG tBSaLNlniTIzc5IeTibHhRGcAso686TRlfqmg5fy2lZXuFJRJuXs4OaLPmIgVH9uYcpaxH9kPip oI21nedm/vZ5fShT/Jf+pwjNbDbSPrQ/Ap5r5XtjgYR8qbS90u092r1SWNHnShgHhjV8bZGIh2g 01 X-Google-Smtp-Source: AHgI3IYeSGKxnu237PxepBc2/ReAl5Fuzq3jfIGV7RIVQAtgY0H4PflZMcgSYboHe8oLmMWzGU5gBVl99ROpMrv6cMtS X-Received: by 2002:ac8:4647:: with SMTP id f7mr4840163qto.40.1549412493879; Tue, 05 Feb 2019 16:21:33 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:17 -0800 In-Reply-To: Message-Id: <84b3464c07a827a7aa3fd427ab97754b107886a7.1549411880.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 3/8] t5503: fix overspecification of trace expectation From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In order to extract the wants from a trace, a loop in t5503 currently breaks if "0000" is found. This works for protocol v0 and v1, but not v2. Instead, teach t5503 to look specifically for the "want" string, which is compatible with all protocols. Signed-off-by: Jonathan Tan --- t/t5503-tagfollow.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh index 4ca48f0276..6041a4dd32 100755 --- a/t/t5503-tagfollow.sh +++ b/t/t5503-tagfollow.sh @@ -47,7 +47,7 @@ get_needs () { test -s "$1" && perl -alne ' next unless $F[1] eq "upload-pack<"; - last if $F[2] eq "0000"; + next unless $F[2] eq "want"; print $F[2], " ", $F[3]; ' "$1" } From patchwork Wed Feb 6 00:21:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10798709 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1D2B013B4 for ; Wed, 6 Feb 2019 00:21:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D6EA2C60A for ; Wed, 6 Feb 2019 00:21:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0104C2C621; Wed, 6 Feb 2019 00:21:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B1FA2C60A for ; Wed, 6 Feb 2019 00:21:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727039AbfBFAVi (ORCPT ); Tue, 5 Feb 2019 19:21:38 -0500 Received: from mail-yw1-f73.google.com ([209.85.161.73]:55405 "EHLO mail-yw1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbfBFAVh (ORCPT ); Tue, 5 Feb 2019 19:21:37 -0500 Received: by mail-yw1-f73.google.com with SMTP id q82so3445805ywg.22 for ; Tue, 05 Feb 2019 16:21:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=6dB7isPigwx3PmBaNbvlCFttHsejMNGlq2l8QBjFnoo=; b=fggDVKWNodS06VdFgR/pKCMB5yvf4Ln3NMmiij6djNQ5DOXXVzHYeOT//1RggJuNOy S4XLKH2SpPBKQY4wo5eu+Kpj/Fy4bpzC7g3bp2BiONvp6ln2g0PnQ/nBrKnVczrbfl3v 864xgpsm9P3FZKXYYI5y+srBMxiF80/303qAFw/jnOxI/s56syhUtkZqmzCUGc5vDase zsIUj55FWWCw1XECReT7RQNfF/Q5jvbbdZMovvIU9LPholuea6v6qiCbB646FBqV9tRH ylTLj3XClTtln1kQ7KTacNjc+mCYQcXz9cAkKBy4RtQm63Q8TmpQoMFmhUHHChEcrmyR MGaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=6dB7isPigwx3PmBaNbvlCFttHsejMNGlq2l8QBjFnoo=; b=mG8cR/3SkEteNZ1gDRDxPcGalVwTpQCUeuzc3ClnB4BV3Z02u0dkFHUYqs/V5+COGD SeBzBSfcAO9kMm4QpA8m/wKaLynf8d4s/8Ky3ZkCtQVXJsf8SJYEeY38nGK+weYFRT8E oGFb2FC4qK7ZKaYlcHqhdHRuEI6rhz+AbWsNO9tRBeuu2vEsz6pkv3KWst9Xl+wWw01g LvTnz+ODf3WDspf53SAomwCTv9xSpX0KwZw84e1RxEBt+LoER6dBy8EbZSP1XxPScwcG xfJyDzHNUPx6Sq9e+qb5amrhB0KBIlW1N4p0YiONplK7E5ueTATXesjQ4B7y4DISbEjV AhmQ== X-Gm-Message-State: AHQUAubJlZTtzdepQbAMgvqZIX0E9ZqZU2QUVb9pinsTJ40wY61PtMUZ bhakyQm7CJzha6cSnIwajWxBSlnubGkReNt3x6cKvgwJbJOPqV8d4M7nttfVq6L+Lz6bVvWz4b2 KTqBgKpSRlzWomcIKmFlg5K7kgwhaQnvcs1caVRxwJ/mByLanjvPGYmTEQcZbibU38e5oC/tzrN 5D X-Google-Smtp-Source: AHgI3IZkDdVERL72m+FKF8Pv6ZRzEm/uX/hejgP91KStthDeJF7xGX4qiAUk59Jlf7hbN5cZCi6gnucKEu+NKOX36zLw X-Received: by 2002:a25:4646:: with SMTP id t67mr3349918yba.72.1549412496595; Tue, 05 Feb 2019 16:21:36 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:18 -0800 In-Reply-To: Message-Id: <05b1b94c479760c17d38beafc3d45ad9a5a08d0d.1549411880.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 4/8] t5512: compensate for v0 only sending HEAD symrefs From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Protocol v2 supports sending non-HEAD symrefs, but this is not true of protocol v0. Some tests expect protocol v0 behavior, so fix them to use protocol v0. Signed-off-by: Jonathan Tan --- t/t5512-ls-remote.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index ced15ae122..e3c4a48c85 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -223,7 +223,9 @@ test_expect_success 'ls-remote --symref' ' $(git rev-parse refs/tags/mark1.10) refs/tags/mark1.10 $(git rev-parse refs/tags/mark1.2) refs/tags/mark1.2 EOF - git ls-remote --symref >actual && + # Protocol v2 supports sending symrefs for refs other than HEAD, so use + # protocol v0 here. + GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref >actual && test_cmp expect actual ' @@ -232,7 +234,9 @@ test_expect_success 'ls-remote with filtered symref (refname)' ' ref: refs/heads/master HEAD 1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD EOF - git ls-remote --symref . HEAD >actual && + # Protocol v2 supports sending symrefs for refs other than HEAD, so use + # protocol v0 here. + GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . HEAD >actual && test_cmp expect actual ' @@ -243,7 +247,9 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' ' 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master EOF - git ls-remote --symref --heads . >actual && + # Protocol v2 supports sending symrefs for refs other than HEAD, so use + # protocol v0 here. + GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual && test_cmp expect actual ' @@ -252,9 +258,11 @@ test_expect_success 'ls-remote --symref omits filtered-out matches' ' 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master EOF - git ls-remote --symref --heads . >actual && + # Protocol v2 supports sending symrefs for refs other than HEAD, so use + # protocol v0 here. + GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref --heads . >actual && test_cmp expect actual && - git ls-remote --symref . "refs/heads/*" >actual && + GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref . "refs/heads/*" >actual && test_cmp expect actual ' From patchwork Wed Feb 6 00:21:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10798711 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9442413B4 for ; Wed, 6 Feb 2019 00:21:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8514D2C60A for ; Wed, 6 Feb 2019 00:21:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 799D12C621; Wed, 6 Feb 2019 00:21:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35E412C60A for ; Wed, 6 Feb 2019 00:21:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727122AbfBFAVk (ORCPT ); Tue, 5 Feb 2019 19:21:40 -0500 Received: from mail-vs1-f74.google.com ([209.85.217.74]:35696 "EHLO mail-vs1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbfBFAVk (ORCPT ); Tue, 5 Feb 2019 19:21:40 -0500 Received: by mail-vs1-f74.google.com with SMTP id g5so2228951vsi.2 for ; Tue, 05 Feb 2019 16:21:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=SRWiHPmmntvQcIiavlynWCvgBTBK6iS5deX71ZKXJq4=; b=tLRjQg4UmDczrYgUfVu9CmJz6FSJy+JHB7lNQAK7e7dHPaJo+nuYYPj6p1CK9qdgWO PTJRAy3oFHGMXqvk16okb1gqkp6mV2wyFLxKU6pPSDrAScUVSo5BsIH6b6x00yXMyLPY AX7mYekzdnV3YeYY/vWZnC60VFaNE4GAohKpy2OaC4JB5APr7QbJpaQy/j0lsjlQ+vHu KtSnoFPrYnuU5Bq76db9KoaNCtv2/Ed+R/DAm0URY4lZooAGk51lA0HeIUvIXIXB6/0J 9BuCX75+1MMg8A38Hyg05lwhxNJkWFEV2285/J1Xm3sM62+Os+HrzOehryrXm8eL0soE aV0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=SRWiHPmmntvQcIiavlynWCvgBTBK6iS5deX71ZKXJq4=; b=GXRGLv4BABOjGG7rTt0WdZxGZuC9BSgVbl25ym4vrPGj1TZPNYDK1bK0Vv8ml9ScJB xfDlr2u6M9mwgWmxfhpekuLC9YLPEb4aA3JO2AG3CdlkzUna+gwPZzzhbY4YOxhY7znp a+/tZOD4hkflsCOVkQQCPNuGrvQFdpVp9tSbzkf6mRGy3La3KV7J0IQyWSoi3n9Ml6I7 TXY9O8+u6w3StPN1nouMJtQo/W32b3azaqVKl4YPRqW8OVr67CFivhE7FUD2UNnXJhLe 1/QpFdREzTLrtxzA6dKYzPVA9QyGqfnXMz63iIG9e06nRSSb1bk/Q/eP1Cq/JYbBeYip itkw== X-Gm-Message-State: AHQUAuYg6U/QulggvWl0hny8rudI4yh7rIySwSzEUEUPpkyD3q4/s+ZM dUwu5ScfBO0FDBVOeyvUmXTAiQhcflOKsUoT3r6xmyPo7tA7x0HrdnBbAIhjuQZex0egNSEiWhH oI3toukYZ2fFtpNPdVxtV1FnnxRcLzuobTsyfvr7S9VurP4dHKR7BfDWDsM/qI+87tezc5ZNDyh cu X-Google-Smtp-Source: AHgI3IZt3B5hVOwGL74mZtPQvM8y8mchzOdcd+04/TqFbLMq79R5zT/uT+oOgeDUOwH4QhS+6ntv70ykOexRn9+nOwYp X-Received: by 2002:ab0:1423:: with SMTP id b32mr4880916uae.8.1549412499049; Tue, 05 Feb 2019 16:21:39 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:19 -0800 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 5/8] t5700: only run with protocol version 1 From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Jonathan Tan --- t/t5700-protocol-v1.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh index 2e56c79233..9857bd0ecb 100755 --- a/t/t5700-protocol-v1.sh +++ b/t/t5700-protocol-v1.sh @@ -4,6 +4,9 @@ test_description='test git wire-protocol transition' TEST_NO_CREATE_REPO=1 +# This is a protocol-specific test. +GIT_TEST_PROTOCOL_VERSION= + . ./test-lib.sh # Test protocol v1 with 'git://' transport From patchwork Wed Feb 6 00:21:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10798713 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 86AA6922 for ; Wed, 6 Feb 2019 00:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 774D52C60A for ; Wed, 6 Feb 2019 00:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6C08F2C621; Wed, 6 Feb 2019 00:21:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DA5772C60A for ; Wed, 6 Feb 2019 00:21:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727181AbfBFAVo (ORCPT ); Tue, 5 Feb 2019 19:21:44 -0500 Received: from mail-pl1-f202.google.com ([209.85.214.202]:41442 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726051AbfBFAVm (ORCPT ); Tue, 5 Feb 2019 19:21:42 -0500 Received: by mail-pl1-f202.google.com with SMTP id y2so3613656plr.8 for ; Tue, 05 Feb 2019 16:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=PYGLdWqh1LU7TNKWqYuvoASbCBilXhprZo+al8e4zj0=; b=hdLkwtZBNVsBJPrGvWe0vHBfBE1DRES18XadNW3bNxoIK4Tzfr2zpGvf0AMJSZHKTu Zsv2UiB6m7mlJa9i8dwPmKV9QzpdJhWder4OK/yaS0/aVtfU6eT+SOO0aUW5nUF83Q09 h6qEVVcB4BlNYDg0ssV+Lx3fojyTNpbhdkOjhBbBrAqY27SyCq1LxauUGkZCzbwy2+V7 DnjKpL/uX04DKvtWAQ9VU4DR4BHKX22m+VUzCR0DbmWdwEjEjHIum4atUYwus3ljpjrd o56uRAul6al2KfsyC2ljjKYhBfzc8AYruefzhZCXc0lYmomAMtGI26g6q3/dbxLt4ow5 s/Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=PYGLdWqh1LU7TNKWqYuvoASbCBilXhprZo+al8e4zj0=; b=FGiC0fhDc1/H1ec1/vyzfOKDO8ar2zSObqYUqq/uzAD31Cq/cY5mgWxAqY8w5Iya24 SG53TI1pmJIl8B4smzZqwMG1RbNKiFzxSWKb4Tl+9CUIWYAzMTJ/KvOwBC3fqj/7QUCS sb8MCpvXi0jGaGY3wI8PX3ld3G+yu2NbwAxObsKotf3u01J+3HHFbfVMH15cdLIyigOU X1ZvWjURpZ1ByUbdhHFT/F5NgW8k4eYxoHnnCrOXPWZ0AH7OjCJoOWYd84yMYVN5Ko1l R3Nl+yr9WkJnVa0Bqb8sKt2Kw07amUSHRvrkDrFZbHJgWHRq7euaMf3SPLhCT7Nw3M8Q LUrA== X-Gm-Message-State: AHQUAubwG8CwjjzmUHgBRdu/hBJzsiGxoTs7WyqkOAde7Hd3mMw25TKX bsRtCBtE1zWNbZ8tUBKEScYWEU2z2kw+xMssaN/d4HX7MoOBtz46uBa9oH2OyAFCPWLivz+EcQk YU+sOfx0ezk6OBFIdNKw0FDuYuPePNLstp8ajVGnbKjV1aP7sLXCksuUsCE4XkXsHjrFVQcM6sr 4V X-Google-Smtp-Source: AHgI3IZctfacIx9R85qLEzZYv3WjUwSt6AtkhK+P5gthFMlcxSHjqJk2qSmelMExvdH95W66t4GshMUs1rWHLuQrqqdw X-Received: by 2002:a63:780d:: with SMTP id t13mr2808470pgc.39.1549412501417; Tue, 05 Feb 2019 16:21:41 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:20 -0800 In-Reply-To: Message-Id: <8569ae986ee99ec92c2d844b6092664a8b47ad06.1549411880.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 6/8] tests: fix protocol version for overspecifications From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These tests are also marked with a NEEDSWORK comment. Signed-off-by: Jonathan Tan --- t/t5515-fetch-merge-logic.sh | 4 ++++ t/t5539-fetch-http-shallow.sh | 5 ++++- t/t5541-http-push-smart.sh | 14 ++++++++++++-- t/t5551-http-fetch-smart.sh | 34 ++++++++++++++++++++++++++-------- 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh index 36b0dbc01c..e55d8474ef 100755 --- a/t/t5515-fetch-merge-logic.sh +++ b/t/t5515-fetch-merge-logic.sh @@ -6,6 +6,10 @@ test_description='Merge logic in fetch' +# NEEDSWORK: If the overspecification of the expected result is reduced, we +# might be able to run this test in all protocol versions. +GIT_TEST_PROTOCOL_VERSION= + . ./test-lib.sh LF=' diff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh index 5fbf67c446..cdb687b93a 100755 --- a/t/t5539-fetch-http-shallow.sh +++ b/t/t5539-fetch-http-shallow.sh @@ -67,7 +67,10 @@ test_expect_success 'no shallow lines after receiving ACK ready' ' cd clone && git checkout --orphan newnew && test_commit new-too && - GIT_TRACE_PACKET="$TRASH_DIRECTORY/trace" git fetch --depth=2 && + # NEEDSWORK: If the overspecification of the expected result is reduced, we + # might be able to run this test in all protocol versions. + GIT_TRACE_PACKET="$TRASH_DIRECTORY/trace" GIT_TEST_PROTOCOL_VERSION= \ + git fetch --depth=2 && grep "fetch-pack< ACK .* ready" ../trace && ! grep "fetch-pack> done" ../trace ) diff --git a/t/t5541-http-push-smart.sh b/t/t5541-http-push-smart.sh index 5475afc052..0e3055ab98 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -47,7 +47,12 @@ test_expect_success 'no empty path components' ' cd "$ROOT_PATH" && git clone $HTTPD_URL/smart/test_repo.git/ test_repo_clone && - check_access_log exp + # NEEDSWORK: If the overspecification of the expected result is reduced, we + # might be able to run this test in all protocol versions. + if test -z "$GIT_TEST_PROTOCOL_VERSION" + then + check_access_log exp + fi ' test_expect_success 'clone remote repository' ' @@ -128,7 +133,12 @@ GET /smart/test_repo.git/info/refs?service=git-receive-pack HTTP/1.1 200 POST /smart/test_repo.git/git-receive-pack HTTP/1.1 200 EOF test_expect_success 'used receive-pack service' ' - check_access_log exp + # NEEDSWORK: If the overspecification of the expected result is reduced, we + # might be able to run this test in all protocol versions. + if test -z "$GIT_TEST_PROTOCOL_VERSION" + then + check_access_log exp + fi ' test_http_push_nonff "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git \ diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index d2661eb338..e8ed185b33 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -82,12 +82,18 @@ test_expect_success 'clone http repository' ' /^< Content-Length: /d /^< Transfer-Encoding: /d " >actual && - sed -e "s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \ - actual >actual.smudged && - test_cmp exp actual.smudged && - grep "Accept-Encoding:.*gzip" actual >actual.gzip && - test_line_count = 2 actual.gzip + # NEEDSWORK: If the overspecification of the expected result is reduced, we + # might be able to run this test in all protocol versions. + if test -z "$GIT_TEST_PROTOCOL_VERSION" + then + sed -e "s/^> Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \ + actual >actual.smudged && + test_cmp exp actual.smudged && + + grep "Accept-Encoding:.*gzip" actual >actual.gzip && + test_line_count = 2 actual.gzip + fi ' test_expect_success 'fetch changes via http' ' @@ -105,7 +111,13 @@ test_expect_success 'used upload-pack service' ' GET /smart/repo.git/info/refs?service=git-upload-pack HTTP/1.1 200 POST /smart/repo.git/git-upload-pack HTTP/1.1 200 EOF - check_access_log exp + + # NEEDSWORK: If the overspecification of the expected result is reduced, we + # might be able to run this test in all protocol versions. + if test -z "$GIT_TEST_PROTOCOL_VERSION" + then + check_access_log exp + fi ' test_expect_success 'follow redirects (301)' ' @@ -217,8 +229,14 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set git config http.cookiefile cookies.txt && git config http.savecookies true && git ls-remote $HTTPD_URL/smart_cookies/repo.git master && - tail -3 cookies.txt | sort >cookies_tail.txt && - test_cmp expect_cookies.txt cookies_tail.txt + + # NEEDSWORK: If the overspecification of the expected result is reduced, we + # might be able to run this test in all protocol versions. + if test -z "$GIT_TEST_PROTOCOL_VERSION" + then + tail -3 cookies.txt | sort >cookies_tail.txt && + test_cmp expect_cookies.txt cookies_tail.txt + fi ' test_expect_success 'transfer.hiderefs works over smart-http' ' From patchwork Wed Feb 6 00:21:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10798715 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4B47A13B4 for ; Wed, 6 Feb 2019 00:21:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3ADB22C60A for ; Wed, 6 Feb 2019 00:21:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D02D2C621; Wed, 6 Feb 2019 00:21:47 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B58F92C60A for ; Wed, 6 Feb 2019 00:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727207AbfBFAVp (ORCPT ); Tue, 5 Feb 2019 19:21:45 -0500 Received: from mail-vs1-f73.google.com ([209.85.217.73]:54359 "EHLO mail-vs1-f73.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbfBFAVp (ORCPT ); Tue, 5 Feb 2019 19:21:45 -0500 Received: by mail-vs1-f73.google.com with SMTP id v199so2162855vsc.21 for ; Tue, 05 Feb 2019 16:21:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=c5eafgfC+uPgjJecVEUZDa4WPYVYyn2cMXyiBBc6yK4=; b=JPyy2KwA4Nq75GqztbRw2djV4AyGFDyCxDTKD4nLVlb5un2A1MzSfK3GpYaUbsqQ0O R2aze1ZgD/vh5elAjUJtaKJ78dDeSIoHSUQhge/9HwFjnpAeLN+bVf9Sv9Y51zsTGwBj PBgxSDsOE+Yd7P/EqGGlvLkqxr4U5N56J3WXNvXcg0EdT32BMTmA5YPMs73WGfLOo7Fi IZXyaXL2GA8hvI62sVnjuYpOF26mYQxMeqg1bp5oOzE6vWd1ElF62SNhlsOSGhKnEKvc AG1KVa4ahrE4wkD6+ba4X0LOOhuJRz+q0+rp3JwuAyhY4bpatnonp8HewzOR29yLF5LP LCng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=c5eafgfC+uPgjJecVEUZDa4WPYVYyn2cMXyiBBc6yK4=; b=YBBz/fi5JrzmboPWH2tER1lLmKerF8JePYkQMWGsd2BIyZjrLgEMorVT3S6Rx9yr7L dA1SsrUG1HTqkIWAgNJ8HridZVWeUb/ZV1NrvlrH2DH/3DIrRFzYAIlT+eze90MsrW0p rrdcLWP5DZlnZqpN3d2F1a2l9T9sByyAbn8PfXXelLqCgt1UXL7DHpKCN23bGvcJjKud BP5nqF2xLkiYT/LLVHNx9KDGOEUUceGw1dy4DW9xvk4DbKF7B00PnMXEYn4VBT4cSwQe 8ZmL5LEk7pMiZApXiopWP+dmYGBaLS5Nm6h0gADJgArUhx/7pnGbTcPbLbGx4FrbK9y6 0fcA== X-Gm-Message-State: AHQUAuYzNODWSW2ln+Z3nguqP7YnKmyliPXx+hnwBuG+jTbDVBP1K0u2 1QGysb0L6IW/DLu6i54Wwm55FJacv/3FXMNv1y8LYCNR4SQJRis0kOGieLq0CKLW4Q/tLwBRCns pu6VrIa1lQMuuhEVrijEs1Zp4D/rVzEA6dwKtkqARCD2CW7E5xhARD26GQUZvpy/s8Y5A/eFBKw TL X-Google-Smtp-Source: AHgI3IZzYfLON33hbHdjxHCQaUgKipxNNw1HyE2C9Rii8mmiLZBnDd0+DOzPux/YfruL8Tuoq+c1Y1xlUd/fOVld8BzS X-Received: by 2002:ab0:2388:: with SMTP id b8mr4882112uan.16.1549412503853; Tue, 05 Feb 2019 16:21:43 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:21 -0800 In-Reply-To: Message-Id: <2e8ad7ab247e6b14c0583f0800a228e95bcda095.1549411880.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 7/8] t5552: compensate for v2 filtering ref adv. From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Protocol v2 filters the ref advertisement, but protocol v0 does not. A test in t5552 uses the ref advertisement, so fix it to use protocol v0. Signed-off-by: Jonathan Tan --- t/t5552-skipping-fetch-negotiator.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh index 30857b84a8..8a14be51a1 100755 --- a/t/t5552-skipping-fetch-negotiator.sh +++ b/t/t5552-skipping-fetch-negotiator.sh @@ -127,7 +127,10 @@ test_expect_success 'use ref advertisement to filter out commits' ' # not need to send any ancestors of "c3", but we still need to send "c3" # itself. test_config -C client fetch.negotiationalgorithm skipping && - trace_fetch client origin to_fetch && + + # The ref advertisement itself is filtered when protocol v2 is used, so + # use v0. + GIT_TEST_PROTOCOL_VERSION= trace_fetch client origin to_fetch && have_sent c5 c4^ c2side && have_not_sent c4 c4^^ c4^^^ ' From patchwork Wed Feb 6 00:21:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10798717 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B45D713B4 for ; Wed, 6 Feb 2019 00:21:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A48F42C60A for ; Wed, 6 Feb 2019 00:21:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 992532C621; Wed, 6 Feb 2019 00:21:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, USER_IN_DEF_DKIM_WL autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EF8B2C60A for ; Wed, 6 Feb 2019 00:21:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727262AbfBFAVs (ORCPT ); Tue, 5 Feb 2019 19:21:48 -0500 Received: from mail-pl1-f202.google.com ([209.85.214.202]:53018 "EHLO mail-pl1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbfBFAVq (ORCPT ); Tue, 5 Feb 2019 19:21:46 -0500 Received: by mail-pl1-f202.google.com with SMTP id 71so3603348plf.19 for ; Tue, 05 Feb 2019 16:21:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=G2xvV8tnV/PToPTaS5y6rVnMuq8BqsEGObq/fCfkyxc=; b=crdaJsF45aBbyv8rvfzLuaPvoXlgz8A/tFWaA+/5rbDPhuOgZS9U2kYMgrOQ2iI9Ds jFC81Bdf319h5v1iwY41Sj/D5d2gGL5PpJHiBSTTAVO4PpAky5Yc8MmIUU3Hfs3FcYZG /RP6ylctmDPZZvHU5fEe0HVEQ84eEplkQSiHGjVkqNmQZQvFKsocz35YblVqjyAAnjir R1nnBW7fQ7vIKLrcp0NzwrHVFrqfyJcJd65m3CEaCBwnj3D5MMgv+ZlAdTRUf+qwSvjO fROL1x6XJfCXnGrnvERQNp5NrKzxPxTgKV6N8fF3sizevtV1flz5H/h3RAC+7JXYzzYi y69Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=G2xvV8tnV/PToPTaS5y6rVnMuq8BqsEGObq/fCfkyxc=; b=NS+OQxx+hwzG8c2opqRbNESQT7JZ4MaUle0XmbD4bhm+MZeQxs3Z0h2newEIorqJTO EDATRSNcMZCP6xDd9Pap/CYXp/+cgWjbHYnLSmoUMhiws1GUvwysD96Y4R9ufzZVxQjw TRIGIO0M2Yt3l2/WGxm0anLpUp7a1ardGOSrjrnAb1Sx86MrKLEnLDF2DRL+b9+xzebM DoghrgBbSz9Pwmfx5chQm+iLBiqpupo8yW/gd3jUvxF8THBS8UhH4GCu1Guj/c6tJbIZ tYBZ2i5Wrat93cBQD7XcOodkup91hkq4KMjLtqTK+8fpGkofvj1vb7vJZnYOTnDVrs4y Txhg== X-Gm-Message-State: AHQUAuZWiLewA15I1vLDvFExHdQFhe9ZaaUhh9ourQKSHLMgwHv0dRSx Z6FBiXhIwS2ZurR75hhvl+D0KIIgYYeT6CUo6RLHLfOiDDPlb/3XE/IjOeodlnTxuGCR9ctBnd0 PGwU9CG9BeXV3AD3rU3cwizPbbF+FQxVkmtQNdYGI8Nhixbm01nPEiZ/32yidpo3NvTgEWH0JSZ IG X-Google-Smtp-Source: AHgI3IYZdwN7SR/P5M9FD6LGD49dzzqGil38rXb2SuEQCWCk4awQwmn1V3H5s/JM2V9VNOu78ohkG3sa6y4ATMwk8Avx X-Received: by 2002:a63:a4b:: with SMTP id z11mr2887545pgk.14.1549412506285; Tue, 05 Feb 2019 16:21:46 -0800 (PST) Date: Tue, 5 Feb 2019 16:21:22 -0800 In-Reply-To: Message-Id: <8d5ff2fc224e2ce7981bcae492de02a622889208.1549411880.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [PATCH 8/8] remote-curl: in v2, fill credentials if needed From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , steadmon@google.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In post_rpc(), remote-curl calls credential_fill() if HTTP_REAUTH is returned, but this is not true in proxy_request(). Do this in proxy_request() too. When t5551 is run using GIT_TEST_PROTOCOL_VERSION=2, one of the tests that used to fail now pass. Signed-off-by: Jonathan Tan --- remote-curl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/remote-curl.c b/remote-curl.c index 293bcdb95b..437a8e76d8 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -1295,7 +1295,9 @@ static size_t proxy_out(char *buffer, size_t eltsize, static int proxy_request(struct proxy_state *p) { struct active_request_slot *slot; + int err; +retry: slot = get_active_slot(); curl_easy_setopt(slot->curl, CURLOPT_ENCODING, ""); @@ -1312,7 +1314,12 @@ static int proxy_request(struct proxy_state *p) curl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, proxy_out); curl_easy_setopt(slot->curl, CURLOPT_WRITEDATA, p); - if (run_slot(slot, NULL) != HTTP_OK) + err = run_slot(slot, NULL); + if (err == HTTP_REAUTH) { + credential_fill(&http_auth); + goto retry; + } + if (err != HTTP_OK) return -1; return 0;