From patchwork Tue Dec 11 21:21:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 10724771 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 7B27C112E for ; Tue, 11 Dec 2018 21:21:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6ADCD2B2C3 for ; Tue, 11 Dec 2018 21:21:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EBC22B328; Tue, 11 Dec 2018 21:21:53 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 032AC2B2C3 for ; Tue, 11 Dec 2018 21:21:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726219AbeLKVVw (ORCPT ); Tue, 11 Dec 2018 16:21:52 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:50442 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbeLKVVv (ORCPT ); Tue, 11 Dec 2018 16:21:51 -0500 Received: by mail-wm1-f67.google.com with SMTP id n190so3749293wmd.0 for ; Tue, 11 Dec 2018 13:21:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xT00o3JXqSxbPbtNIMBUG7zizVMO7INjVY1027kYa40=; b=TO65SDMCrFroIfC9jJcmliS/AZvlDS5yC4/r9nli7Gmm7dzNvx3OkeisywaCPHy1yf kdsyblHs6byiK0iZvAzM2ZtEOasRDInDI/PE1qodhThqx4yS5dwp26YbVyIQRgXlPZFv 78l6JIHiJ6abNSohGEiLF6VnAoM/4MsgF7hF+Wr+E53TPH/iYvC2Ymmi9AGxtYvAP7t7 Ofgb69mX7RAgx2YeMk57rv1p2Dx9L2+DhYCBAWs/CDCfz3m1yd7lo54quUG45dZ3tRvR IIymQPOqr225iAQ3OQB2a6Ze8TBRf2W55G0Q7fWk7vgaaeQz0FKPf3tr8TAKXwgoFnlH Nflg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xT00o3JXqSxbPbtNIMBUG7zizVMO7INjVY1027kYa40=; b=s7YUB04+z4kR7ViD+JZ0qsatWWZYXlyzf2f5XcBRnUpPqU2hZfIR5BsrIFhoTZ3ZyN n6xzQFDNvtf2GQHLiP7RGpGq9zT4e8WUFeJqGRKfYlzmUdj9sshm7qE14OvcFKk3VSHz wJj9XObWhekT+uu4Gs/qoYSqjvRCDN2+TycZAIHrRmAHQF+F2Z7SyMNk8eYQhmQY/OQO ACR7Sld9XigMGxhyFdvFkt49Eb6IykUUtpv2JgF7BjaDDAkZlKOa/0G9WiENfeTXLdk/ 1RX/undCI4PZnjHBi76wqWmexHmAwSZGPD31w3nBV1pMsbT2IjtKYKRsRXCIGNTCrGe8 rGgg== X-Gm-Message-State: AA+aEWbmm+1pYSWZ8gjrpSdvhnVImqzIHAUKQpnZzzTiCpcVXJGvAZ49 u29Y0RMCzOcJg8aC2NzSe0rSvrxj X-Google-Smtp-Source: AFSGD/VQuX9zBDoUFYj4SV8MntPrNFPN0mwuEs6+NC4n+W2a3IvZG7ceq9wIpATaNAcahEbu6RkOPg== X-Received: by 2002:a7b:c442:: with SMTP id l2mr3909299wmi.140.1544563308159; Tue, 11 Dec 2018 13:21:48 -0800 (PST) Received: from vm.nix.is ([2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id g198sm1698118wmd.23.2018.12.11.13.21.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 13:21:47 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Brandon Williams , Jonathan Tan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 1/3] tests: add a special setup where for protocol.version Date: Tue, 11 Dec 2018 22:21:33 +0100 Message-Id: <20181211212135.21126-2-avarab@gmail.com> X-Mailer: git-send-email 2.20.0.405.gbc1bbc6f85 In-Reply-To: <20181211135501.GA13731@sigill.intra.peff.net> References: <20181211135501.GA13731@sigill.intra.peff.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add a GIT_TEST_PROTOCOL_VERSION=X test mode which is equivalent to running with protocol.version=X. This is needed to spot regressions and differences such as "ls-refs" behaving differently with transfer.hideRefs. See https://public-inbox.org/git/20181211104236.GA6899@sigill.intra.peff.net/ for a fix for that regression. With this all tests pass with GIT_TEST_PROTOCOL_VERSION=0, but fail with GIT_TEST_PROTOCOL_VERSION=[1|2]. That's OK since this is a new test mode, subsequent patches will fix up these test failures. Signed-off-by: Ævar Arnfjörð Bjarmason --- protocol.c | 13 ++++++++++++- t/README | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/protocol.c b/protocol.c index 5e636785d1..cb58cbb29a 100644 --- a/protocol.c +++ b/protocol.c @@ -17,7 +17,18 @@ static enum protocol_version parse_protocol_version(const char *value) enum protocol_version get_protocol_version_config(void) { const char *value; - if (!git_config_get_string_const("protocol.version", &value)) { + const char *git_test_k = "GIT_TEST_PROTOCOL_VERSION"; + const char *git_test_v = getenv(git_test_k); + + if (git_test_v) { + enum protocol_version version = parse_protocol_version(git_test_v); + + if (version == protocol_unknown_version) + die("unknown value for %s: %s", git_test_k, + git_test_v); + + return version; + } else if (!git_config_get_string_const("protocol.version", &value)) { enum protocol_version version = parse_protocol_version(value); if (version == protocol_unknown_version) diff --git a/t/README b/t/README index 28711cc508..c5762a92bc 100644 --- a/t/README +++ b/t/README @@ -358,6 +358,10 @@ GIT_TEST_MULTI_PACK_INDEX=, when true, forces the multi-pack- index to be written after every 'git repack' command, and overrides the 'core.multiPackIndex' setting to true. +GIT_TEST_PROTOCOL_VERSION=<'protocol.version' config value>, when set, +runs the test suite with the given protocol.version. E.g. "0", "1" or +"2". + Naming Tests ------------ From patchwork Tue Dec 11 21:21:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 10724773 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 A4FE214E2 for ; Tue, 11 Dec 2018 21:21:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 95B072B2C3 for ; Tue, 11 Dec 2018 21:21:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 899482B328; Tue, 11 Dec 2018 21:21:55 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 227DF2B2C3 for ; Tue, 11 Dec 2018 21:21:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726229AbeLKVVy (ORCPT ); Tue, 11 Dec 2018 16:21:54 -0500 Received: from mail-wm1-f49.google.com ([209.85.128.49]:38095 "EHLO mail-wm1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726209AbeLKVVx (ORCPT ); Tue, 11 Dec 2018 16:21:53 -0500 Received: by mail-wm1-f49.google.com with SMTP id m22so3809957wml.3 for ; Tue, 11 Dec 2018 13:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nhWPq0WpHuEyy9X3jRHVjriWxER6b0QvL7DMjO62ADY=; b=e5WAtttcOyKIz7/P+4U5vrTl2HwxDTY8TuCglb3OlZ+KIm9JHhLmOYX/zb968IWuNB syVWdQ26qH7cC+5KOVHWPm8hjMTg/IZHNh+8NMOTnwZce/o2VBJuBZWXWUvP/fynAL9P mcPiEZkMEujKc8ua1x1dmD2bPBvBCNIRo9rwj3gviG8IzZLG3ed3+dRCUjILlh15k68V 5O6sGP7YKcKzVlOhNE833hodoG7UAHNT5UXuY9oFO2snF89PPqFg/s9PnHuS2pOQZTm0 f2X+fwnDe088zx7tJS506EZo05q0xKDKeVSoDdPMPdbrOtm/n5Y+icoOBg+3ZsddLGnt xJZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nhWPq0WpHuEyy9X3jRHVjriWxER6b0QvL7DMjO62ADY=; b=CT0AgxQaHs0vHUmgVLqg191fcS8BS4VniXviAgruPrmOWxBVMdhSQcV6VbMyhVY0Ny K/9c5Smg9KrZSxSv2NcbZznq1A8+7BjjxqwNIr9aYXj6IB5PDKs2C2ZugibfN+v1I4vS R2uDaFWQMP+wkYYHf6HBXs6nkl+R87PGljoGwfcC2iMxguoyEMkQzUJ1F1r3eENzclK1 xyqrluxcN7MaqJUH8nQ1RG3cVktKVzIIsIkePVxvHD90NG8NHO2fOLvb05smKLWWZSo0 bBVT7I8r8Y2KKh9eXGdlUMv1tCA0uztzutRqlqr96cqbdreyvPzJWAB4cWnyRGNxL6GV tYPg== X-Gm-Message-State: AA+aEWYph6TRon83KdT0p2yy5JXeKKxO/xmTv6K7nE+8Ftviemw+Z9YC bPWsNOJP91mF6PdhcMl+tpISjqyb X-Google-Smtp-Source: AFSGD/UvrhZz3RIm+CfWJcK0QD1NFDEKYeEk5Wi0AamSLOz6k85qZIYVhOCvJIRew3p+560QSa8/tA== X-Received: by 2002:a7b:c44d:: with SMTP id l13mr3947339wmi.144.1544563309578; Tue, 11 Dec 2018 13:21:49 -0800 (PST) Received: from vm.nix.is ([2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id g198sm1698118wmd.23.2018.12.11.13.21.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 13:21:49 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Brandon Williams , Jonathan Tan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 2/3] tests: mark tests broken under GIT_TEST_PROTOCOL_VERSION=1 Date: Tue, 11 Dec 2018 22:21:34 +0100 Message-Id: <20181211212135.21126-3-avarab@gmail.com> X-Mailer: git-send-email 2.20.0.405.gbc1bbc6f85 In-Reply-To: <20181211135501.GA13731@sigill.intra.peff.net> References: <20181211135501.GA13731@sigill.intra.peff.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A few tests are broken under GIT_TEST_PROTOCOL_VERSION=1, which as protocol.version in git-config(1) notes is just the GIT_TEST_PROTOCOL_VERSION=0 with a version number. All of these cases look OK to me, and don't seem to show any regressions or other behavior differences that are unexpected. These tests are either testing exact v0 trace output, or trying to test the v2 protocol. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t0410-partial-clone.sh | 1 + t/t5400-send-pack.sh | 2 +- t/t5516-fetch-push.sh | 1 + t/t5601-clone.sh | 1 + t/t5702-protocol-v2.sh | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) diff --git a/t/t0410-partial-clone.sh b/t/t0410-partial-clone.sh index ba3887f178..786f96c467 100755 --- a/t/t0410-partial-clone.sh +++ b/t/t0410-partial-clone.sh @@ -171,6 +171,7 @@ test_expect_success 'fetching of missing objects' ' ' test_expect_success 'fetching of missing objects works with ref-in-want enabled' ' + sane_unset GIT_TEST_PROTOCOL_VERSION && # ref-in-want requires protocol version 2 git -C server config protocol.version 2 && git -C server config uploadpack.allowrefinwant 1 && diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index f1932ea431..b84618c925 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=0 \ git push \ --receive-pack="unset GIT_TRACE_PACKET; git-receive-pack" \ fork HEAD:foo && diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 37e8e80893..49e5d305e5 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1172,6 +1172,7 @@ test_expect_success 'fetch exact SHA1' ' ' test_expect_success 'fetch exact SHA1 in protocol v2' ' + sane_unset GIT_TEST_PROTOCOL_VERSION && mk_test testrepo heads/master hidden/one && git push testrepo master:refs/hidden/one && git -C testrepo config transfer.hiderefs refs/hidden && diff --git a/t/t5601-clone.sh b/t/t5601-clone.sh index 8bbc7068ac..a9ce050ee9 100755 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@ -345,6 +345,7 @@ expect_ssh () { } test_expect_success 'clone myhost:src uses ssh' ' + sane_unset GIT_TEST_PROTOCOL_VERSION && git clone myhost:src ssh-clone && expect_ssh myhost src ' diff --git a/t/t5702-protocol-v2.sh b/t/t5702-protocol-v2.sh index 0f2b09ebb8..df7cc2a43a 100755 --- a/t/t5702-protocol-v2.sh +++ b/t/t5702-protocol-v2.sh @@ -5,6 +5,7 @@ test_description='test git wire-protocol version 2' TEST_NO_CREATE_REPO=1 . ./test-lib.sh +sane_unset GIT_TEST_PROTOCOL_VERSION # Test protocol v2 with 'git://' transport # From patchwork Tue Dec 11 21:21:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 10724775 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 2654114E2 for ; Tue, 11 Dec 2018 21:21:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 138B92B2C3 for ; Tue, 11 Dec 2018 21:21:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0604C2B328; Tue, 11 Dec 2018 21:21:58 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 318882B2C3 for ; Tue, 11 Dec 2018 21:21:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726245AbeLKVV4 (ORCPT ); Tue, 11 Dec 2018 16:21:56 -0500 Received: from mail-wm1-f51.google.com ([209.85.128.51]:36402 "EHLO mail-wm1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbeLKVVz (ORCPT ); Tue, 11 Dec 2018 16:21:55 -0500 Received: by mail-wm1-f51.google.com with SMTP id a18so3825112wmj.1 for ; Tue, 11 Dec 2018 13:21:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=up4tQ6C6BhUAlh9veD8Q6DDPw9YyLe3nDcHPdCzHdeI=; b=JgLvBPJqs6K/OTV4Vo2XVVb6sPG1uXHA+nm0JwDoe7d3v+Xnv9+GAdSH+rP0Khk1Fd /DcGpd+T4TwQ1vcLkPO1SlX/NOONMWJjm7uIZb398haNMPbMIfPOgBtBE91xnVdSVAn/ ImvkomH6LS610caQg6ekusnHPInHJatR2c2FLNJTe8J4TkFYtMJPvw9m0O65/jumIxQ8 tkjYGm105sCZ1FHMBJmnrboXVvnUrjoSf5IUyMVsC3CgMbwWXavgB+BsXkgeWF1AEFBp MOizV0ONWLGLOoYwDTP7EZC+GEf3FLkLmyXzj3cBoMXmmuLr2ARabFL7ZRwB2bi1pQMj YdZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=up4tQ6C6BhUAlh9veD8Q6DDPw9YyLe3nDcHPdCzHdeI=; b=psPk/L3j+1fqtIR3urbpinCQgp/55Q7+wAAYTGF+FUi9YsfDoyBHDLec9nWySyyQd9 ZKPOgzCc5BRqVWHVZMO5ISQYt/KCDzLrtwUTS/7wEzNwWE3qKiyGdKr+PXM8zr3zKTEC eYqHPPbD89uX12yn0n57InCqsgtyXVrD3ZdPJemqVm039NSIikDpVmBRC/U8fiNnozG+ ZXfEW+75Wg1HK6bDMHfjmhnUSl57n8j8Rzh/4H0nf+EZM52h6a42M/u1M4SehgqxhnyB OkMMHGNUXAXog4eDpo/pbHUrPhE+6MTY6bk/69kb3LJQiEuHPWtI4uJU/VX9vvIPV75p CCiA== X-Gm-Message-State: AA+aEWa0fqsIFL3+CEgJ3Wmab9ICZmiwn5+APobZooqehJGTzQeYXuy/ 96T6OOo3hamkqlINNx5ffLYUIUbhrzaETQ== X-Google-Smtp-Source: AFSGD/VyiWDKdgi6pOBHwRu1iPNp3DljPrDDtpkIZ81pSwRUvtZTbbQ9GlacdrPAEIYIFtDzZ3+wrQ== X-Received: by 2002:a1c:8c05:: with SMTP id o5mr3634885wmd.29.1544563312573; Tue, 11 Dec 2018 13:21:52 -0800 (PST) Received: from vm.nix.is ([2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id g198sm1698118wmd.23.2018.12.11.13.21.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Dec 2018 13:21:51 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Brandon Williams , Jonathan Tan , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBC?= =?utf-8?b?amFybWFzb24=?= Subject: [PATCH 3/3] tests: mark tests broken under GIT_TEST_PROTOCOL_VERSION=2 Date: Tue, 11 Dec 2018 22:21:35 +0100 Message-Id: <20181211212135.21126-4-avarab@gmail.com> X-Mailer: git-send-email 2.20.0.405.gbc1bbc6f85 In-Reply-To: <20181211135501.GA13731@sigill.intra.peff.net> References: <20181211135501.GA13731@sigill.intra.peff.net> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Mark those tests that have behavior differences or bugs under protocol.version=0. Whether or not these tests should exhibit different behavior is outside the scope of this change. Some (such as t5700-protocol-v1.sh) clearly should, but others (such as t7406-submodule-update.sh) might indicate bugs in the protocol v2 code. Tracking down which is which is outside the scope of this change. Let's first exhaustively annotate where the differences are, so that we can spot future behavior differences or regressions. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t5500-fetch-pack.sh | 4 +++- t/t5503-tagfollow.sh | 8 ++++---- t/t5512-ls-remote.sh | 8 ++++---- t/t5515-fetch-merge-logic.sh | 1 + t/t5516-fetch-push.sh | 3 ++- t/t5537-fetch-shallow.sh | 3 ++- t/t5552-skipping-fetch-negotiator.sh | 1 + t/t5616-partial-clone.sh | 3 ++- t/t5700-protocol-v1.sh | 1 + t/t7406-submodule-update.sh | 3 ++- 10 files changed, 22 insertions(+), 13 deletions(-) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 086f2c40f6..9c18875c9c 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -41,7 +41,8 @@ pull_to_client () { test_expect_success "$number pull" ' ( cd client && - git fetch-pack -k -v .. $heads && + GIT_TEST_PROTOCOL_VERSION=0 \ + git fetch-pack -k -v .. $heads && case "$heads" in *A*) @@ -440,6 +441,7 @@ test_expect_success 'setup tests for the --stdin parameter' ' ' test_expect_success 'fetch refs from cmdline' ' + sane_unset GIT_TEST_PROTOCOL_VERSION && ( cd client && git fetch-pack --no-progress .. $(cat ../input) diff --git a/t/t5503-tagfollow.sh b/t/t5503-tagfollow.sh index 4ca48f0276..220c677f24 100755 --- a/t/t5503-tagfollow.sh +++ b/t/t5503-tagfollow.sh @@ -56,7 +56,7 @@ test_expect_success 'fetch A (new commit : 1 connection)' ' rm -f $U && ( cd cloned && - GIT_TRACE_PACKET=$UPATH git fetch && + GIT_TRACE_PACKET=$UPATH GIT_TEST_PROTOCOL_VERSION=0 git fetch && test $A = $(git rev-parse --verify origin/master) ) && get_needs $U >actual && @@ -86,7 +86,7 @@ test_expect_success 'fetch C, T (new branch, tag : 1 connection)' ' rm -f $U && ( cd cloned && - GIT_TRACE_PACKET=$UPATH git fetch && + GIT_TRACE_PACKET=$UPATH GIT_TEST_PROTOCOL_VERSION=0 git fetch && test $C = $(git rev-parse --verify origin/cat) && test $T = $(git rev-parse --verify tag1) && test $A = $(git rev-parse --verify tag1^0) @@ -122,7 +122,7 @@ test_expect_success 'fetch B, S (commit and tag : 1 connection)' ' rm -f $U && ( cd cloned && - GIT_TRACE_PACKET=$UPATH git fetch && + GIT_TRACE_PACKET=$UPATH GIT_TEST_PROTOCOL_VERSION=0 git fetch && test $B = $(git rev-parse --verify origin/master) && test $B = $(git rev-parse --verify tag2^0) && test $S = $(git rev-parse --verify tag2) @@ -146,7 +146,7 @@ test_expect_success 'new clone fetch master and tags' ' cd clone2 && git init && git remote add origin .. && - GIT_TRACE_PACKET=$UPATH git fetch && + GIT_TRACE_PACKET=$UPATH GIT_TEST_PROTOCOL_VERSION=0 git fetch && test $B = $(git rev-parse --verify origin/master) && test $S = $(git rev-parse --verify tag2) && test $B = $(git rev-parse --verify tag2^0) && diff --git a/t/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index ca69636fd5..28420c4f77 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -223,7 +223,7 @@ 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 && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref >actual && test_cmp expect actual ' @@ -243,7 +243,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' ' 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master EOF - git ls-remote --symref --heads . >actual && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual && test_cmp expect actual ' @@ -252,9 +252,9 @@ 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 && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual && test_cmp expect actual && - git ls-remote --symref . "refs/heads/*" >actual && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref . "refs/heads/*" >actual && test_cmp expect actual ' diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh index 36b0dbc01c..2a3d1d84d6 100755 --- a/t/t5515-fetch-merge-logic.sh +++ b/t/t5515-fetch-merge-logic.sh @@ -7,6 +7,7 @@ test_description='Merge logic in fetch' . ./test-lib.sh +sane_unset GIT_TEST_PROTOCOL_VERSION LF=' ' diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index 49e5d305e5..0722d288cd 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1129,7 +1129,8 @@ do ' done -test_expect_success 'fetch exact SHA1' ' +test_expect_success 'fetch exact SHA1 in protocol v0' ' + sane_unset GIT_TEST_PROTOCOL_VERSION && mk_test testrepo heads/master hidden/one && git push testrepo master:refs/hidden/one && ( diff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh index 6faf17e17a..f8f14c0ca2 100755 --- a/t/t5537-fetch-shallow.sh +++ b/t/t5537-fetch-shallow.sh @@ -127,7 +127,8 @@ test_expect_success 'fetch that requires changes in .git/shallow is filtered' ' git init notshallow && ( cd notshallow && - git fetch ../shallow/.git refs/heads/*:refs/remotes/shallow/*&& + GIT_TEST_PROTOCOL_VERSION=0 \ + git fetch ../shallow/.git refs/heads/*:refs/remotes/shallow/* && git for-each-ref --format="%(refname)" >actual.refs && cat <expect.refs && refs/remotes/shallow/no-shallow diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh index 30857b84a8..c5b39b8248 100755 --- a/t/t5552-skipping-fetch-negotiator.sh +++ b/t/t5552-skipping-fetch-negotiator.sh @@ -127,6 +127,7 @@ 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 && + sane_unset GIT_TEST_PROTOCOL_VERSION && trace_fetch client origin to_fetch && have_sent c5 c4^ c2side && have_not_sent c4 c4^^ c4^^^ diff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh index 336f02a41a..feedf84ce1 100755 --- a/t/t5616-partial-clone.sh +++ b/t/t5616-partial-clone.sh @@ -144,7 +144,8 @@ test_expect_success 'manual prefetch of missing objects' ' sort >observed.oids && test_line_count = 6 observed.oids && - git -C pc1 fetch-pack --stdin "file://$(pwd)/srv.bare" revs && diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh index ba86a44eb1..244ff6879d 100755 --- a/t/t5700-protocol-v1.sh +++ b/t/t5700-protocol-v1.sh @@ -5,6 +5,7 @@ test_description='test git wire-protocol transition' TEST_NO_CREATE_REPO=1 . ./test-lib.sh +sane_unset GIT_TEST_PROTOCOL_VERSION # Test protocol v1 with 'git://' transport # diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index e87164aa8f..dd41a96c20 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -943,7 +943,8 @@ 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 && + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ + 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 &&