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 ------------