From patchwork Wed Jan 16 22:42:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10767041 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 817AA91E for ; Wed, 16 Jan 2019 22:42:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 718372F00C for ; Wed, 16 Jan 2019 22:42:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 65ACC2F788; Wed, 16 Jan 2019 22:42:27 +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 EF2C92F00C for ; Wed, 16 Jan 2019 22:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387492AbfAPWmZ (ORCPT ); Wed, 16 Jan 2019 17:42:25 -0500 Received: from mail-qt1-f201.google.com ([209.85.160.201]:47732 "EHLO mail-qt1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732830AbfAPWmZ (ORCPT ); Wed, 16 Jan 2019 17:42:25 -0500 Received: by mail-qt1-f201.google.com with SMTP id f2so7236139qtg.14 for ; Wed, 16 Jan 2019 14:42:24 -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=ouit/+S6TOXxvnTb6MOzXk3zHaz8h/7euMXbFNM5Vdw=; b=J/7DR5cBZYWphbCshYRjZ5evO8+xPRgliP9/cKFIRGZmzFr9el3q387Quh/fJvEf4j fATLOMcMk4+rUX1QiB+EvoaLCRyRhOHPK/88p3kQtrF3A8McG62WFURVhMYm7AqsE/VH fH++qM1wlZBm/U5Xuf6LaBB9ecpRQTrI8OQ9Pcd2E24+/jzKBijy47icjDDV7YvT93Vl p6TO5DkL60scKdd7yuEhQHh8SHFwKgdWoJ9tLYXzRhTD9nCv/ewKB2+/PAs2ewQ4UAIS mS4kiNi9IZl0z/XqK881Ni+1jf6RbtOKZ+M04IbusR15yCEWPknkTBfwmj18kt7sgAwe ZJeg== 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=ouit/+S6TOXxvnTb6MOzXk3zHaz8h/7euMXbFNM5Vdw=; b=pWCaGkM/8n37DbmxPcDYct25+VP3X604SlFMSsaOVazWPkjVClJAHrLeGdPL8WDjWN QDLkjGnUoWDKrKMBxyQ9ej1jI57uybmtGUVus4QP/tSKbCJbw6EGA+f14xZk83h8ToG/ rKkflh3y8tp0UkxgpoEHL0NFOu324sOQE6UuwKOxJYttVryHDIEIw8QfQwDdLx/Wbg5c wXvP6jgD00b8I1zgP9dmCNoyE5fPyEP0aLVwPDLH2MAragaTNxikYI4w3axCxLLZB/3C ZdbWECCdPzi34J1qM6V1KoEU3MqKxT1bpGohRKX5sbHn41qtesHmrkrWVRap3J+dM16L iLpA== X-Gm-Message-State: AJcUukeJM6vm7G6j+p1cyRxT4XGnfLrPlEO1KRLHy9FHZveiN3vpu8La GPv1GF2vrQFHrvZF70h53CbRwKrEnewdrNGa/b9bHc/M3IzKf9ZG3cpdg7bqN9sUl2muG1n0tC7 0QO/bKPowF6htMNstu3VV+b9WobNPUPzajV3ITbdQK1yy+/1X1Ilccj3z17/rq8fqD1JLfLYDza EQ X-Google-Smtp-Source: ALg8bN5if0dh3QtNBxFAiMEwwoWhetqTR/EcvbXVxQjHSFd7EpbimJ+vs/4G4/DogkqyGYV+JLmIED8BPAG7Anga5wWn X-Received: by 2002:ae9:e90b:: with SMTP id x11mr6236980qkf.56.1547678544232; Wed, 16 Jan 2019 14:42:24 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:09 -0800 In-Reply-To: Message-Id: <241afc6b556334fe212147e94167e3f23d4e21f5.1547677183.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 1/8] tests: define GIT_TEST_PROTOCOL_VERSION From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 28711cc508..fd7f29cbe1 100644 --- a/t/README +++ b/t/README @@ -311,6 +311,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: 10767043 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 F370B17FB for ; Wed, 16 Jan 2019 22:42:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E504E2F00C for ; Wed, 16 Jan 2019 22:42:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D98EF2F788; Wed, 16 Jan 2019 22:42:29 +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 4A90B2F00C for ; Wed, 16 Jan 2019 22:42:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387475AbfAPWm2 (ORCPT ); Wed, 16 Jan 2019 17:42:28 -0500 Received: from mail-qt1-f201.google.com ([209.85.160.201]:39318 "EHLO mail-qt1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733220AbfAPWm2 (ORCPT ); Wed, 16 Jan 2019 17:42:28 -0500 Received: by mail-qt1-f201.google.com with SMTP id u20so7206560qtk.6 for ; Wed, 16 Jan 2019 14:42:27 -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=X3J5Fi3U5arcWdQ1/HVF1b4N1mLjJneOjiMyeBddlAVYtSn9K22BFkOQVY7m4EqndR FdjxtkQxNwrwlMduWffFDDjSlTKMy2TNVxUGu4kT9cKySDouApcFAoa3DGzX9tlCq++a omyK6Y4RWnWNZxEnHAd4/dRSEiPtyZ+dgZULbb+iRYPHpon6PxFDkTVMQuliGHkun8b4 aHOSxYXZ0ZRylX92SNc4vqkzWtJu8KGmUOibi6aBTARw1O+6n4zfLnUJ8S2ifLEwHxEf bnQyZh66eeNc7im102hyT6EPI63ykCi4XPp9wNFsMMNMvmQQkeM9d11Yb75HjObKkoyF UUcg== 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=OY8+OJ/sOjcl2I6oC0Jxr/85brVFT1NdV87VbzPIUoc1J8OOvRhU2wcbbBs25rC2rS otwGQy14GqJ0hhKO+YTe+X2TcZjouISR3lQL3dr09a7UKDmaf01txXx7YTkH5EZLHeCx /gSzndUe3ZGi3t/3ZoMZFB+6DgzdeoOYms6UxwqFHicCm0kXBdLVamWNdhXbVBtYcR1D 4x4bWIXHEw9NaO4O3/aNsgzWE/HF6uoI2PYVSlGTdpwooMJksPrPbK1pls85DllEU/R4 vFTkmcsZPuPOIbxxsqhsXXbFlFvctuLCblb8PuQ71P50y4qfj2mdmzuN7ryPQMSbnkJD ffPw== X-Gm-Message-State: AJcUukd50JzgzcJAYoWdn8SR6PlCMpW6c8weY80ms5N6lpWduOFL1DR+ G7k4n7zw9TFj0OO5uG/RgOUOEIlkRq6bATcDUJA+4wjTg6Vf5ZAAN27wgfkY0T2ikIV0dMpoC// wV2O5everFpIbGxJm4x00+qYMIV9wBJOJJ5iKavZHY13QWmgmGVQs7bFY5uLW+r3b5SSlwY8gaQ cr X-Google-Smtp-Source: ALg8bN5jZ6PgrMadZYG7GIn+VurUuU4gcBSp52sm0oTmVdbNT+FjsWOK0kYmCyyv0U6ypXswxH6mkVlhwsm6xE91SNqi X-Received: by 2002:aed:376a:: with SMTP id i97mr6551181qtb.0.1547678546864; Wed, 16 Jan 2019 14:42:26 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:10 -0800 In-Reply-To: Message-Id: <0484d242fa689ad0fd0d342216d9e729ca35ba24.1547677183.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 2/8] tests: always test fetch of unreachable with v0 From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 Jan 16 22:42:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10767045 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 62D4317FB for ; Wed, 16 Jan 2019 22:42:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 552332F00C for ; Wed, 16 Jan 2019 22:42:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4989E2F788; Wed, 16 Jan 2019 22:42:32 +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 F3CF42F00C for ; Wed, 16 Jan 2019 22:42:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387496AbfAPWma (ORCPT ); Wed, 16 Jan 2019 17:42:30 -0500 Received: from mail-vs1-f74.google.com ([209.85.217.74]:46590 "EHLO mail-vs1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733288AbfAPWma (ORCPT ); Wed, 16 Jan 2019 17:42:30 -0500 Received: by mail-vs1-f74.google.com with SMTP id n87so3392888vsi.13 for ; Wed, 16 Jan 2019 14:42: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; bh=v5ncvF0/tMxmsjbrRb4qeq3WPVkNRAUgsE/fIVkGHIM=; b=Zanj5d2a1GNGCX4UhFZ8xtMrnCTKy2L6l+WqG0YTi00TkSy+OQ+vFMFnHxCCiZPgZu SVTiBoUSJy/g2SAnz/Z8kfw+0E23LJer66mUUUxlOH2f+ze8wVX2GETV30HCpzG7N2cj XEMu+WtCoEByKhNKOpJBVXh3iK7f+nvGnKEizkpSIMprKzYYUh6SoeGiuAfwB/SOzXkP uofup7ts+d7p9Miak1SDh2NooZGREvbdHD+EmXjxhsghRnFHbPFvPX7HsAN3JPenZQl/ tLhu+Sz3Y/uR7+Jk4U6D9a64atKCvsroVfds2t0ZEQ5lK8gchLyHA3LYkTlhTgXFBzyN 61VA== 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=LY96ZURh7od7xeKzb5IZDZkLkyXry6oURFptC49iQlYdDSBeG7s8j/zUmjmgQ5fI0o +PEYp3fVjAioOg5idmbD52JMv56Ir6aq4O2j6kp0HpSA0J+m3hyHgNrgzjba+KSjhnwO R2e+0pgEX6xUJD5jeloQtao4uMz03FnUmyiK3mxNIm493srZZE+sisLFPGgy3GszCP09 krKTKmSj6suqZbVhD4MCCsR85yotAMc27l0HM4kQWIgmOToe9fv6K+gDwGmYfXyowHNW guyC95NcD/1rcFZOBYV1nOUMjma8HQFq3UvWHK/SUHDZY7kLLM6TN1OYksJZjKUCpnQD GH+Q== X-Gm-Message-State: AJcUukcn0xCTHMxjyLDa53Fz57HRw5flF3i3BSxYOqiSF76P05vq7mbW PyvddQqhshN5unVL6qMd24IDuWkLk8GBkc+RVaUp1s/AEa1Sx8TP4ysoW7kH184nSwIp0afDFIe BNLkHeISr/bo9oYQwIC33H8Fji3DbLPTIz5mYIDIwtbm3hQD9Bg4xHfM5G5oc5nRMtiuIAaIn46 0g X-Google-Smtp-Source: ALg8bN6Kc0cCAg+d1LYWli/sTAJwixJ8h/O4I5kCgSEICGNkqAGxy/IY59jMVSFRDJk9IVBpzvNU2wMOc8llT3Vg1ICE X-Received: by 2002:a1f:f8e:: with SMTP id 136mr6935787vkp.4.1547678549619; Wed, 16 Jan 2019 14:42:29 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:11 -0800 In-Reply-To: Message-Id: <0820b3411cf217fd3fe0ecf40edafd7adec4851e.1547677183.git.jonathantanmy@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 3/8] t5503: fix overspecification of trace expectation From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 Jan 16 22:42:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10767047 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 2050991E for ; Wed, 16 Jan 2019 22:42:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 119B82F77A for ; Wed, 16 Jan 2019 22:42:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 05B272F7A1; Wed, 16 Jan 2019 22:42:35 +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 A1B9B2F77A for ; Wed, 16 Jan 2019 22:42:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387442AbfAPWmd (ORCPT ); Wed, 16 Jan 2019 17:42:33 -0500 Received: from mail-qt1-f202.google.com ([209.85.160.202]:51620 "EHLO mail-qt1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733220AbfAPWmd (ORCPT ); Wed, 16 Jan 2019 17:42:33 -0500 Received: by mail-qt1-f202.google.com with SMTP id n39so7078802qtn.18 for ; Wed, 16 Jan 2019 14:42:32 -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=yFMbKxObszIPvCbm2y8O4EHUtLdZ+flEYXrnKhT19U0=; b=Evh73L7Hv5N1qHuijWvTn8/OE6M67U6ZjEQujyuCBdI1nT+5G3OrdrZLxCFRLf+8C9 5Oa8pPRfkiWx5/oEUME/b/kc7wMHkgYqUNVjOeUdaEGX0IRMvPwwHvMHElDBi5siNuXJ Z8EUalUnG4ZJTj9c8x+JGqDC+IlKMBs+B1WgZX2ybsttDAH9uHQzI3O00oE2RfY7x5zj JUMCqYs98FOAd9VEhAkc/SdVWYNa7eO6p1KLqoW/Rz18LkuNpZcp663zIy2Nd4pKBmRt 6mvQ4iXIeEPpTEgfy8/5kUdr4wA6jCPnqaENABEjimQFLdJo/KcGW4Pp74kSzwWYWnqU e3lA== 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=yFMbKxObszIPvCbm2y8O4EHUtLdZ+flEYXrnKhT19U0=; b=kPxiGVK3Mq56o66zZPqRLzTBuuXsPBvxOxiBUEyQeu2Gn7JtaAFfTjnO6NNtW/kEV3 iG6tTZy274B0dJRY+NmRBBttcsrFC3ssjgfL+kR8g9xxiQ+u0MpAGumQplGyxEJ21V7H f7AMo7tNYM3qbQnmuPRJnrgSXpsxKk4X4clwQo6Jol470um0REvTq8sGyt8rresiyDsP oA0LmYPk9+gmtetvvsK4h3q1Cn8DsrIHte4syBFy2SE1PQ5jwX4AQ+4E2knCnyTxL+az pJRNuTgup4mYAUSOP12b3VfU0Mru8pAGuBj2BctIdOu0kjpLAqrxenEVbfrcmii+7TYx tXEw== X-Gm-Message-State: AJcUukcUZkoi74fk8WoadxoQnjtyBQeN3Hs5qNFNRfYlaxu+RTjW2W95 ISmIGi2YCit/BWfTftVpizIV7R9FPS2QDROI8KbTHALuBuK7tzLhZPmW9WNUOQQoxggEIFQC0U4 MVEYpJlCTZqz9Q+zahuVdGo9JpvA9xVzg+pHkxJJ4tXZCGlfO+txEoxEyHrv8qSJk3Ql3k27b4v RV X-Google-Smtp-Source: ALg8bN4KpegASwHK/R3SU/uAYZhieYaZDjAHA9dvsmoGlCtRAj6SrTQJHUPOMe87CUTlMJyZ0Ndp3VsCEI9KBfs8+CRo X-Received: by 2002:ae9:c210:: with SMTP id j16mr6082801qkg.22.1547678552141; Wed, 16 Jan 2019 14:42:32 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:12 -0800 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 4/8] t5512: compensate for v0 only sending HEAD symrefs From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 ca69636fd5..d3bac6f2ee 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 Jan 16 22:42:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10767049 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 8B8CA91E for ; Wed, 16 Jan 2019 22:42:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7CC1D2F77A for ; Wed, 16 Jan 2019 22:42:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 711972F7A1; Wed, 16 Jan 2019 22:42: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 197902F77A for ; Wed, 16 Jan 2019 22:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387506AbfAPWmg (ORCPT ); Wed, 16 Jan 2019 17:42:36 -0500 Received: from mail-vs1-f74.google.com ([209.85.217.74]:45639 "EHLO mail-vs1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733220AbfAPWmf (ORCPT ); Wed, 16 Jan 2019 17:42:35 -0500 Received: by mail-vs1-f74.google.com with SMTP id t136so3289926vsc.12 for ; Wed, 16 Jan 2019 14:42:35 -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=Rh3GdYZa53wLDGm42DK1qjRlEM+Y3sWMtyRjMwzgSX+/8e+6CLu3lN+lvqZ/f1v169 vTwUlHV2RS0rRpKUpWWJ9WzxMqKJqmckj9Pqj81T7G9XujZNWyjwXTwnGDJaG/1fDYxh KqYbGD/SVqtXfPI2iasOeQSOJOaWXK863yW+rnMB/P8x71OOSDChdCPUl/MBz4KcC7TL BKTYn57Z3UrwLHdtY3CUdZqKQzsnv4+GhJtFEWnmN8nIFoYhlvqoJ4HpyZAufBLaecdU JzRxa9MSvxZzmncrlnoagDd22I1hKgmcMTcCT34zlmImWIq5m0GXECPxJW4bMKfPFhdh nFyQ== 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=SO6P0czrOHvpRcR1EsqeoeDFlq4GkUXn/85cjfG9pmdGPLsgeVRgECsZyVd4olXIdK 0zLNOxcX2ZLseZMaKCXo3tSbnXpUuZvTNvxgSutBQn+yTLcR8HYQI8IFA2thozJPcbuO lCDD/dRmF0dmu00mWWYZwA1+LGGqlQ3o1/oifzndVdIU0ye9VBWHfGt5jAAq4alXtOJv eNs2jGw8bQ15uA6D7JzJTUmABYOEPbR5Cfe1GOzt1VRxSOFwdZKSA6lIQpOmYJ7Uh7Jh DL7NifJMetkh22R56IhfZygsr0GOD7sB8tAkbSLUKexTUJT+pWziM12doCcDedD0Yaeg C9Yw== X-Gm-Message-State: AJcUukc7ahsr/ZL5iPYauadRO+8BWrsGHW2ZrYzpyoAM7HKf8Wm1yDyC MHGFsEua+g+/j04MkRdgRftWQt//1bYjwyYpPGU8a1Zrk3h3H4msMBcBPBVaE6qZt7EPPurzA30 CC5ncfqE1uNkR5AvMyXM8jhC5lcMWsdgXOtI1W+5p/4pJiD7p9ZpZHGqeQjWpzNJF2ql9fFUqjZ e+ X-Google-Smtp-Source: ALg8bN7/4wuXSCEKsNa32Zt5PeQV50gp4YvTxHEKzD7u69qdqcW98VCb2A8M5llrrUR5ZG9H7qk0TUsp87EfdjqQWFfg X-Received: by 2002:a1f:25c4:: with SMTP id l187mr6913810vkl.7.1547678554899; Wed, 16 Jan 2019 14:42:34 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:13 -0800 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 5/8] t5700: only run with protocol version 1 From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 Jan 16 22:42:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10767051 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 BD15517FB for ; Wed, 16 Jan 2019 22:42:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD9742F00C for ; Wed, 16 Jan 2019 22:42:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A136F2F788; Wed, 16 Jan 2019 22:42:40 +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 27BAC2F77A for ; Wed, 16 Jan 2019 22:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387509AbfAPWmj (ORCPT ); Wed, 16 Jan 2019 17:42:39 -0500 Received: from mail-yw1-f74.google.com ([209.85.161.74]:50951 "EHLO mail-yw1-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733220AbfAPWmi (ORCPT ); Wed, 16 Jan 2019 17:42:38 -0500 Received: by mail-yw1-f74.google.com with SMTP id b8so3888229ywb.17 for ; Wed, 16 Jan 2019 14:42:38 -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=Rb05+SSjk+28W4fEl4jH0m2Nk6UFwRRIj3I7M78lmeXBtgmnKeE5pjjFKNKQlQUIQ+ l1adDz3qMGdqTdsdsA5BpD7faTeTkFNB7jNVfNs25eSzL07gVEUexVILlFQpgUltLIpu Fejs4cDpToypGLsiehMYtwFPzoYa4BMA8AxP9gmzNRm+V9nctzS3cSajQ8VRXdaIdrRw ruERB+u09ZWyvUglKgZR1zRpdnxuZfB2ise0B6AIHRgunYHDGH7EYcR0VNcVKReJ3Qr5 WwqMVkWLGDErulrFs90AeOtWDLzZNu+2AeyUcLDus1kfQ9VBrd1ZNBtwWS7YcNKwHQ6V p3Yw== 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=Knk3HDk5KgIH1+su1/vOny/3k75MPZMXFjvvgbWUXy5Bucsdy9tMWCLE1zvRXqpc3B cHGx0xucuIedUcHx9Iz7wWtFuaT1ZqpI9l1/JwhecRIP5KE5usuA/IlS9frwokZsW9Ae eu+XIMyQhq63rbtwuvg9PHKfIIMItpilzrt0hE8Wdr9Ny49ODvG9ubk2fJH3a94O2Zl8 rwRKPWiaS8LMTY8Dg2+ntOkrk5zqOrfvJr0xMXL0TuLdElzVNHuGZRiPHoo9Rb5ZlKMY fj+sGYPCZnYNuit/UM21kyi6ttEkv+fLSMcDmr5LRUyIrW+iJqQkARc2HPchMlaCU5wp L96g== X-Gm-Message-State: AJcUukcFDjAMt174dC0iHrCrQcyP4OdoJGx5q0wL4tmnMas/+pbH8jOM 8yy7WPM0C6huMD3CbCFPxKDWPXUQ2mrchWHGaF5UJ2DQZ+S/7XZ2gPUEFyBgt2oozMkxKQvGRwg tvUn5IVhMWVyvfSwZdPVkxTfJhWX3WtqlT6IyIjQFWIk/Qn16THDPpvz6E4ASxl/JpjtUF2lrCM nW X-Google-Smtp-Source: ALg8bN5P+82PBz4uZk1mbh5pBv/4W8/6dphRZJ5xCdtk7WQqXvs5byPaxT6Q/UpaTVo6bZksC9s3H+ixkUv6fBW9BjGw X-Received: by 2002:a81:480f:: with SMTP id v15mr1330459ywa.0.1547678557600; Wed, 16 Jan 2019 14:42:37 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:14 -0800 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 6/8] tests: fix protocol version for overspecifications From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 Jan 16 22:42:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10767053 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 8978517FB for ; Wed, 16 Jan 2019 22:42:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B0C52F00C for ; Wed, 16 Jan 2019 22:42:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F7C72F788; Wed, 16 Jan 2019 22:42:43 +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 06E2B2F00C for ; Wed, 16 Jan 2019 22:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387516AbfAPWmm (ORCPT ); Wed, 16 Jan 2019 17:42:42 -0500 Received: from mail-pf1-f202.google.com ([209.85.210.202]:49095 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733220AbfAPWml (ORCPT ); Wed, 16 Jan 2019 17:42:41 -0500 Received: by mail-pf1-f202.google.com with SMTP id t2so5801586pfj.15 for ; Wed, 16 Jan 2019 14:42:41 -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=tReU6hq8/+emf1+fKTQGCAfZi/H7+0SXid1S1hoWBnhKtSTeIINMaje+kU1xvmdJJh 5GRytD8WV32ecBT9vlfxtsWvrYWG6lYNa1CNUdAVKWjNGc3TrFKYBzVQGO0eTydeASY7 +77qyFr3ONH039y8in0Jo44iwve+jSNqQ/lQo1J7sVUVOz5tL9cPVDI2DhoEXUgCuoQ6 bT0oZOoK78c5OKWT2YMnWkZu+5I59n3lgykm0xPa+NSBlUDfkPq5BmtTGYgToZL5CGXT l8t4exPTr0FF8+8VlKsI2YeD2bqLQQVhTIaenQkOnqI3wCE9oJ2CHZtQUBQQJon2p0av P/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=c5eafgfC+uPgjJecVEUZDa4WPYVYyn2cMXyiBBc6yK4=; b=kGzeFtr0mjeB1g+0dMb7OdMFiT0LC71NTHPKexFwLu+JfGQY90BdKCTMjIn2Nu6C5W jdlUiuJ6QgwS87p7q5kSlCgWY5DLhtKymZyq7PDxVCgn/3t8mn1QrNoLhT5ZNoVif385 0ygtuG9Y/m8gE9RZrb7s+xkFVCVtd5valpUHrGMaenCZqkvO3Is83qaC28kmwg+ksQGi uM4TxRFSFU9AViW8uRyM9RcRj6Gw1fotmmVw8DztaxKOugLStXrIKXtafTg2SdkT7BT1 cppxhNeFU20GNZiKsPTQgco6ULRmiKRQqltwaStELCvGa3UjyRit+rCMMKWVAbc2n4Iw GSYA== X-Gm-Message-State: AJcUukdzOhl1Zz2ovBJL+CGhZQyOfcp+5CSkadpodzAQR/pqx3f44MZo cB+vzSX6p1KbXQN8teX1JUfkPoA9SRh/T+f7MzXXvHWhohIKiqN2ZKcUYpe9vd/iiI6Ur+CuNbF nSVqeKOvLBYQMSDXt0WMkd9LRBSU3x9hwaU5pkDDZzVFA+MxLC7KPGmE57hV6exVeyxYZfnE5+e Eg X-Google-Smtp-Source: ALg8bN4IEYbtn4fQFkNJ8IK63mgbXfcySFjSaRKufKmgLIt7Nibg8qNfWkFHarDTFHR1lft81sfusCys8Sy3yozxjD7a X-Received: by 2002:a17:902:14cb:: with SMTP id y11mr3463350plg.42.1547678560968; Wed, 16 Jan 2019 14:42:40 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:15 -0800 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 7/8] t5552: compensate for v2 filtering ref adv. From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 Jan 16 22:42:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Tan X-Patchwork-Id: 10767055 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 9ECAE91E for ; Wed, 16 Jan 2019 22:42:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 900FC2F00C for ; Wed, 16 Jan 2019 22:42:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8498E2F788; Wed, 16 Jan 2019 22:42: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 393BD2F00C for ; Wed, 16 Jan 2019 22:42:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387520AbfAPWmp (ORCPT ); Wed, 16 Jan 2019 17:42:45 -0500 Received: from mail-vk1-f202.google.com ([209.85.221.202]:44310 "EHLO mail-vk1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733220AbfAPWmo (ORCPT ); Wed, 16 Jan 2019 17:42:44 -0500 Received: by mail-vk1-f202.google.com with SMTP id 101so1838561vkd.11 for ; Wed, 16 Jan 2019 14:42: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=pyy1mEW/Nxa7MIynSabDrPuKqyvENdnYz6mgQK0Tn/o=; b=uqzUEopLy/xiRIwBPpPbOrFiH/6hklr9gvoxuvBQOZbJaCSdfZp/+si2gPLiumsRqY LTPLhsLZNYjkRdV90rWbTauXH3H7fLWypakrYGWKM4cnp250p3HUo3kuAQuVqc24tfbU sJpSYPFxcrAbJ8ZyycKMtLiDLG39+b70r2IgN57/7xdTzkI470QoNYj/Hf/SloYjrPuv y0cBdlyI48Yn/yBSnCTVtD+CqvVfav8lKry9DkXpK1x+feUCIQg34oenzcM88e70OcbQ kiKp8btYA7vCBuhmSqguZgezxayJ7ko6hZniLlHh7xV7BsmnzAlVOBi1VQ4zkgCDSEsC kfcQ== 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=pyy1mEW/Nxa7MIynSabDrPuKqyvENdnYz6mgQK0Tn/o=; b=DgTo1jXPXYExcntxJwNXuNScFuP+614v/L6P3LGlc3M2WuAzyb/0H6W0HFrfZw2/Vy xjVcxAwCLeeZyKeyykTmujYrBkA49oX2g3VJdidtVTZEe5uCtpXI1FfSTgchjcBnilDn /3sVwcJuIi+Kj7Kw14XQsGMpSbDD8TVNmVL0Q0WiyH56uXHkB6HRqV6QIpm8/3YZVhuT GwVtNeU6TxIxkBw9UDDUQ7nJUnpzParKSoQmYLq5uX8+aQKH8Ac41z/cWDz74bUv0WTD psafvjdy1QqoHih8t0FvYwhzhiNQY7pd9FE57hciSVGznRKKwEEPxUTfssJN4LO5lacE S1HA== X-Gm-Message-State: AJcUukdP6KcBHYZjianK9NDMyQlQTIHo2uAWoMu/7tjSLrQL0E306sHP DiZJprkNygENkWxKxWYt/UaabRgyeN3Op4wLjfn6s2M0kJusrfFROulh9Yt09TqmkE6YQcJQ+Rf LIw0peyYLnRJbw5zKrS07OoNn9QbhiethtqSQl3S1v7gDIrlLOTLBnUVsLyjlaanSGnWcDoHQmQ 2W X-Google-Smtp-Source: ALg8bN7ElkS69haDdWEPJ+CH+50ohmiG6UwhyLLHUW9PbXiMALzNKhCxVqsmbWq12vXVFSBl43oyRGWh3M/KR8UCLJdD X-Received: by 2002:a67:8110:: with SMTP id c16mr7411321vsd.23.1547678563963; Wed, 16 Jan 2019 14:42:43 -0800 (PST) Date: Wed, 16 Jan 2019 14:42:16 -0800 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.19.0.271.gfe8321ec05.dirty Subject: [WIP 8/8] remote-curl: in v2, fill credentials if needed From: Jonathan Tan To: git@vger.kernel.org Cc: Jonathan Tan , avarab@gmail.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 0d8fe19cc7..cd6749032a 100644 --- a/remote-curl.c +++ b/remote-curl.c @@ -1264,7 +1264,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, ""); @@ -1281,7 +1283,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;