From patchwork Tue Dec 24 00:59:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 11308935 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6324714F6 for ; Tue, 24 Dec 2019 00:59:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41BDC2075B for ; Tue, 24 Dec 2019 00:59:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="p34um6uC" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727183AbfLXA7L (ORCPT ); Mon, 23 Dec 2019 19:59:11 -0500 Received: from mail-pj1-f66.google.com ([209.85.216.66]:36489 "EHLO mail-pj1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726961AbfLXA7K (ORCPT ); Mon, 23 Dec 2019 19:59:10 -0500 Received: by mail-pj1-f66.google.com with SMTP id n59so497469pjb.1 for ; Mon, 23 Dec 2019 16:59:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tJi83eK0PE0bMQ1QC1teAIvoLPJNbnFRLVbcsSfdH6o=; b=p34um6uC7FaBJxulyt25ob8nDARx6J/vAobHUVvvtKswT745lfV3bozmdS5RXH066K wQVnzOgOJCSS8AwJn/3+KpX/q5+8lnSapanqhATr+BH7KDG1pWqfdqG7s7mpAGasG/zk k4Sdg0AMTBoj4V4P+81l4dm6xtH5XWfRCXy/kmxwe7Ck54c+5BFBBTpTtYeV+6lW6+MA Ui9gYxwrajWHOIcAJo5D6E6jafL/6lNrCOs2Iy+6WCGD4dGLA7GUFhbvyZ5y8Juc0NSt BEGWup+mAP+34lZfSxA57++cg22wJ3mBiVGPNGFLf9WqkEPjDd64pXQVRkuYut/XKQWx zLaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tJi83eK0PE0bMQ1QC1teAIvoLPJNbnFRLVbcsSfdH6o=; b=NKKgLEdRlvO4hhXjBrzH+Icbi7u7kvvrFnDmAYdHed/5skIbw1aG81LBAYL53bKXGJ qrs172dI+VprPPhcXBYxYQPL48wiXPErsAl+/vvEF+8aKTx1Jov9Iur3hRNDfx44sORd hztK9zTJ92mTc8m6KwpDXh1533nusSX73pGx7JRvLSZeV4miIKc2UiIGjnZHDopbSSea QyjL7QDGjxf7SVsfE9kFtVr/2o55aatFL0AAveXwixQW1aFDI/LsV6gMNJiFMupBwvJt OarQlWBQ2eOP5OUIenP+e+A6IjcSOBwYZ2pRu4nigvpe3+Wf29ZLhpUZp/d55LtiMh16 UxRA== X-Gm-Message-State: APjAAAWkpabiHBHgWozuSJVo09HFTZPubibf5WplbWqA+8nxmQ3srOOy sj7gLB5j1gTHmFaOmoAKDmHXcZSL X-Google-Smtp-Source: APXvYqwtBpcMInWHcpGNjdJUR39iqERbCTFqV3fgFLxnvOa9AdI/kIqLc0Dlnp5Ii57G3mACttJSBg== X-Received: by 2002:a17:90a:a798:: with SMTP id f24mr2500495pjq.27.1577149149958; Mon, 23 Dec 2019 16:59:09 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:cf67:1de0:170f:be65]) by smtp.gmail.com with ESMTPSA id r66sm26553492pfc.74.2019.12.23.16.59.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 16:59:09 -0800 (PST) Date: Mon, 23 Dec 2019 16:59:07 -0800 From: Jonathan Nieder To: git@vger.kernel.org Cc: Jonathan Tan , Jeff King , Jeff Hostetler Subject: [PATCH 1/5] fetch test: use more robust test for filtered objects Message-ID: <20191224005907.GD38316@google.com> References: <20191224005816.GC38316@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191224005816.GC38316@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "git cat-file -e" uses has_object_file, which can fetch from promisor remotes when an object is missing. These tests end up checking that that fetch fails instead of for the object being missing. By luck, the tests pass anyway: - in one of these tests ("filtering by size"), the fetch fails because (in protocol v0) the server does not support fetches by SHA-1 - in the second, the object is present but the test could pass even if it weren't if the fetch succeeds - in the third, the test sets extensions.partialClone to "arbitrary string" so that when it tries to fetch, it looks up the "arbitrary string" remote which does not exist Use "git rev-list --objects --missing=allow-any", so that the tests pass for the right reason. Noticed while testing with protocol v2, which allows fetching by sha1 by default, causing the first fetch to succeed and the test to fail. Signed-off-by: Jonathan Nieder --- t/t5500-fetch-pack.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 6b97923964..964930b2d2 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -917,7 +917,10 @@ test_expect_success 'filtering by size' ' git -C client fetch-pack --filter=blob:limit=0 ../server HEAD && # Ensure that object is not inadvertently fetched - test_must_fail git -C client cat-file -e $(git hash-object server/one.t) + commit=$(git -C server rev-parse HEAD) && + blob=$(git hash-object server/one.t) && + git -C client rev-list --objects --missing=allow-any "$commit" >oids && + ! grep "$blob" oids ' test_expect_success 'filtering by size has no effect if support for it is not advertised' ' @@ -929,7 +932,10 @@ test_expect_success 'filtering by size has no effect if support for it is not ad git -C client fetch-pack --filter=blob:limit=0 ../server HEAD 2> err && # Ensure that object is fetched - git -C client cat-file -e $(git hash-object server/one.t) && + commit=$(git -C server rev-parse HEAD) && + blob=$(git hash-object server/one.t) && + git -C client rev-list --objects --missing=allow-any "$commit" >oids && + grep "$blob" oids && test_i18ngrep "filtering not recognized by server" err ' @@ -951,9 +957,11 @@ fetch_filter_blob_limit_zero () { git -C client fetch --filter=blob:limit=0 origin HEAD:somewhere && # Ensure that commit is fetched, but blob is not - test_config -C client extensions.partialclone "arbitrary string" && - git -C client cat-file -e $(git -C "$SERVER" rev-parse two) && - test_must_fail git -C client cat-file -e $(git hash-object "$SERVER/two.t") + commit=$(git -C "$SERVER" rev-parse two) && + blob=$(git hash-object server/two.t) && + git -C client rev-list --objects --missing=allow-any "$commit" >oids && + grep "$commit" oids && + ! grep "$blob" oids } test_expect_success 'fetch with --filter=blob:limit=0' ' From patchwork Tue Dec 24 01:00:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 11308945 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2128A921 for ; Tue, 24 Dec 2019 01:00:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F3254206D3 for ; Tue, 24 Dec 2019 01:00:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BlDwW3Fy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727030AbfLXBAE (ORCPT ); Mon, 23 Dec 2019 20:00:04 -0500 Received: from mail-pl1-f172.google.com ([209.85.214.172]:42504 "EHLO mail-pl1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbfLXBAE (ORCPT ); Mon, 23 Dec 2019 20:00:04 -0500 Received: by mail-pl1-f172.google.com with SMTP id p9so7825864plk.9 for ; Mon, 23 Dec 2019 17:00:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=swXz1l8xqR8M8lYSRTQjF3d5fj3eCMHeDB/Nh/woZHw=; b=BlDwW3FyVPgelIjA8FVOrPQYh14YvKIjM+basrueJODHHtEoTDi3vIQUAfrwWB8G4i lpSL87oX8g5yUnCZ+ay+hU8slTFmIHZ0Go0qcWoGaRH+K09XNQSfkZ8+1SKG2VUzdOOM MPcW6pypkLxwMH3HfmvzblRoO1HZeR/VzqkEsJebCZipv+DrebZiBAc/iLXRNtvksXJ4 xXrwYziT3PnaOrCudHxyJDfqO/3VDhaIWwz9qKGazl+a5nZ7db14bojoPYUf7bvpsgVo G4pBnFlGiQF6qNARrR0P0/eUgmRZwi7z3yAxEQLUOalTyozBl3MuORnhk76YkBfH+1QL jjsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=swXz1l8xqR8M8lYSRTQjF3d5fj3eCMHeDB/Nh/woZHw=; b=oJ32xVsiOxmJ/9O752PnCpnJEk9MudPkhgs6VtqzVW3jhnMw8OcfUqD+N5v09CnUe4 KxyvRPrtFRuJqHPwO4HFVnIPmIWFQ/8zfAXGj8tqwC4UlFAXmqPuhTvgkrRtUSqe2lSj QA2FNgBcS5+J7Pute0oKMHuCdLtb10yfTf9EDWgygAdCYAIQsymrpe9AxuoYxFOIyuNl MjXHTyzphaitRv4E4uqX3HLMp1iY4/c1wNTrW3AV1OMGFijN+v2GN0Adkp+9MbGCCtvO 7hAMullSoXChIV4Dq+7c3IU/0XeSt+qVHex+CwlNusiOuqtqnEzK5qNZEWew2+D+yBvf XRMg== X-Gm-Message-State: APjAAAXls8Qbn5Y7C3Mnjmk5pdvu8OHpTMxAKrCklC2DckwBeHybj1ty KYNP8ZOLI0NyB94NdhRDgfI4aRK6 X-Google-Smtp-Source: APXvYqytAuia2fuS077Yxjxc0Rgskv9VXsyTo/5RS3YBCOsUne2HNLuRq3rh9HrDNcRs+A9vrtbBEg== X-Received: by 2002:a17:902:42c:: with SMTP id 41mr21333121ple.7.1577149202841; Mon, 23 Dec 2019 17:00:02 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:cf67:1de0:170f:be65]) by smtp.gmail.com with ESMTPSA id u7sm24898980pfh.128.2019.12.23.17.00.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 17:00:02 -0800 (PST) Date: Mon, 23 Dec 2019 17:00:00 -0800 From: Jonathan Nieder To: git@vger.kernel.org Cc: Jonathan Tan , Jeff King , Jeff Hostetler Subject: [PATCH 2/5] config doc: protocol.version is not experimental Message-ID: <20191224010000.GE38316@google.com> References: <20191224005816.GC38316@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191224005816.GC38316@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Git's protocol version 2 has been working well in production for over a year. Simplify documentation by no longer referring to it as experimental. Signed-off-by: Jonathan Nieder --- Documentation/config/protocol.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Documentation/config/protocol.txt b/Documentation/config/protocol.txt index bfccc07491..0b40141613 100644 --- a/Documentation/config/protocol.txt +++ b/Documentation/config/protocol.txt @@ -45,11 +45,10 @@ The protocol names currently used by git are: -- protocol.version:: - Experimental. If set, clients will attempt to communicate with a - server using the specified protocol version. If unset, no - attempt will be made by the client to communicate using a - particular protocol version, this results in protocol version 0 - being used. + If set, clients will attempt to communicate with a server + using the specified protocol version. If the server does + not support it, communication falls back to version 0. + If unset, the default is `0`. Supported versions: + -- From patchwork Tue Dec 24 01:01:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 11308951 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D001B109A for ; Tue, 24 Dec 2019 01:01:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9A3892073A for ; Tue, 24 Dec 2019 01:01:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ekjx/qfo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726961AbfLXBBO (ORCPT ); Mon, 23 Dec 2019 20:01:14 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37176 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726833AbfLXBBO (ORCPT ); Mon, 23 Dec 2019 20:01:14 -0500 Received: by mail-pf1-f193.google.com with SMTP id p14so9962887pfn.4 for ; Mon, 23 Dec 2019 17:01:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=RH4cVQrGBq8pTer3zt+mAyUZujiV0cR+bmvihh+SW2w=; b=ekjx/qfobFpotsLV+Ph0Tu0li6dwJ7AgrZptofqeIznDGs2gF/HrQkbyRtkoenZHUz g+F+vR/PiPdYbVBtKNtp/INKEP3JPyVg84MWIHwqvEFfpIFfzDWs4O9MtiuAICt96t2R 7QXXTbL/dWcXQCUYCpqNJcrMxfES0K2dJIXRmZY+z207OYtyeUnNxlsJI52hWNERaPs1 Y2Ogof0+gW9xA2b0lKKhxOsG3ZnkaaLJPalEV+8/gqKFr9b8xxtbPgrMSCfAdz/otalK syfGNIKxBR55Gss7QDT2uQkQGn6BNmDtrCmrtjJ3d69NL9oXrH+EB8Q2Ew3JN2kfKYzG M6BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=RH4cVQrGBq8pTer3zt+mAyUZujiV0cR+bmvihh+SW2w=; b=EgidCNgDM2O5kTMpnO5fEwKQZtLAW5iR9TE5TRO7SYFwGlxVoNvftl/d92gELdCsV2 HkkQ2lwz03u5I56a9DUFZM3z7qYaZgxLYADE1pzIF+a4eKJDfy5NxGk4HRRXMiPiBWni zB9CjOnvrJivzrRL9ylsKbax6nbn1BPhJEuYDvZD2oSvXXkz+nTLdXH4g1dzJfg4ENf+ SeHfx0IqFoJWVWDZ9E9tS3adj9BxQWWWVxAvMzgR1oxWo14HuoXBxArj+Y9VaSVBOiFK zhlDfT99Cx8wUEQf02H0wIyvv4C7m4OkEqFlfg7sOK/kQW8zCnwRttd0X5u9vnKWj6OT KK0g== X-Gm-Message-State: APjAAAUIjtVrwkP+nQ0lJJE5EflPNeLvzTDDu6DNh8tVD08uGKkjIT/K cwcfDSeP0l1GjklNNI2Qu+2/NChf X-Google-Smtp-Source: APXvYqzRLlWPo7/BaPix7+RpaDfo7xxC79wk3YRuePZTEXfI3PbMjT2d2FB3LV4s7gNZJn+K0SKkZQ== X-Received: by 2002:a63:710:: with SMTP id 16mr34236097pgh.58.1577149272888; Mon, 23 Dec 2019 17:01:12 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:cf67:1de0:170f:be65]) by smtp.gmail.com with ESMTPSA id z30sm27118846pfq.154.2019.12.23.17.01.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 17:01:12 -0800 (PST) Date: Mon, 23 Dec 2019 17:01:10 -0800 From: Jonathan Nieder To: git@vger.kernel.org Cc: Jonathan Tan , Jeff King , Jeff Hostetler Subject: [PATCH 3/5] test: request GIT_TEST_PROTOCOL_VERSION=0 when appropriate Message-ID: <20191224010110.GF38316@google.com> References: <20191224005816.GC38316@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191224005816.GC38316@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Since 8cbeba0632 (tests: define GIT_TEST_PROTOCOL_VERSION, 2019-02-25), it has been possible to run tests with a newer protocol version by setting the GIT_TEST_PROTOCOL_VERSION envvar to a version number. Tests that assume protocol v0 handle this by explicitly setting GIT_TEST_PROTOCOL_VERSION= or similar constructs like 'test -z "$GIT_TEST_PROTOCOL_VERSION" || return 0' to declare that they only handle the default (v0) protocol. The emphasis there is a bit off: it would be clearer to specify GIT_TEST_PROTOCOL_VERSION=0 to inform the reader that these tests are specifically testing and relying on details of protocol v0. Do so. This way, a reader does not need to know what the default protocol version is, and the tests can continue to work when the default protocol version used by Git advances past v0. Signed-off-by: Jonathan Nieder --- t/t5400-send-pack.sh | 2 +- t/t5500-fetch-pack.sh | 5 +++-- t/t5512-ls-remote.sh | 10 +++++----- t/t5515-fetch-merge-logic.sh | 3 ++- t/t5516-fetch-push.sh | 12 ++++++------ t/t5539-fetch-http-shallow.sh | 2 +- t/t5541-http-push-smart.sh | 4 ++-- t/t5551-http-fetch-smart.sh | 12 ++++++------ t/t5552-skipping-fetch-negotiator.sh | 2 +- t/t5700-protocol-v1.sh | 3 ++- t/t7406-submodule-update.sh | 2 +- 11 files changed, 30 insertions(+), 27 deletions(-) diff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh index 571d620aed..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_TEST_PROTOCOL_VERSION= \ + 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/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 964930b2d2..baa1a99f45 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -440,11 +440,12 @@ test_expect_success 'setup tests for the --stdin parameter' ' ' test_expect_success 'setup fetch refs from cmdline v[12]' ' + cp -r client client0 && cp -r client client1 && cp -r client client2 ' -for version in '' 1 2 +for version in '' 0 1 2 do test_expect_success "protocol.version=$version fetch refs from cmdline" " ( @@ -638,7 +639,7 @@ test_expect_success 'fetch-pack cannot fetch a raw sha1 that is not advertised a git init client && # 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 \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 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/t5512-ls-remote.sh b/t/t5512-ls-remote.sh index d7b9f9078f..459d1fcddf 100755 --- a/t/t5512-ls-remote.sh +++ b/t/t5512-ls-remote.sh @@ -225,7 +225,7 @@ test_expect_success 'ls-remote --symref' ' EOF # Protocol v2 supports sending symrefs for refs other than HEAD, so use # protocol v0 here. - GIT_TEST_PROTOCOL_VERSION= git ls-remote --symref >actual && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref >actual && test_cmp expect actual ' @@ -236,7 +236,7 @@ test_expect_success 'ls-remote with filtered symref (refname)' ' EOF # 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 && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref . HEAD >actual && test_cmp expect actual ' @@ -249,7 +249,7 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' ' EOF # 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 && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual && test_cmp expect actual ' @@ -260,9 +260,9 @@ test_expect_success 'ls-remote --symref omits filtered-out matches' ' EOF # 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 && + GIT_TEST_PROTOCOL_VERSION=0 git ls-remote --symref --heads . >actual && test_cmp expect actual && - GIT_TEST_PROTOCOL_VERSION= 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 961eb35c99..a9a7d50d3e 100755 --- a/t/t5515-fetch-merge-logic.sh +++ b/t/t5515-fetch-merge-logic.sh @@ -8,7 +8,8 @@ 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= +GIT_TEST_PROTOCOL_VERSION=0 +export GIT_TEST_PROTOCOL_VERSION . ./test-lib.sh diff --git a/t/t5516-fetch-push.sh b/t/t5516-fetch-push.sh index c81ca360ac..f12cbef097 100755 --- a/t/t5516-fetch-push.sh +++ b/t/t5516-fetch-push.sh @@ -1151,7 +1151,7 @@ test_expect_success 'fetch exact SHA1' ' # unadvertised objects, so restrict this test to v0. # fetching the hidden object should fail by default - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ 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 && @@ -1210,7 +1210,7 @@ do cd shallow && # Some protocol versions (e.g. 2) support fetching # unadvertised objects, so restrict this test to v0. - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ git fetch --depth=1 ../testrepo/.git $SHA1 && git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true && git fetch --depth=1 ../testrepo/.git $SHA1 && @@ -1241,9 +1241,9 @@ do cd shallow && # Some protocol versions (e.g. 2) support fetching # unadvertised objects, so restrict this test to v0. - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ git fetch ../testrepo/.git $SHA1_3 && - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ git fetch ../testrepo/.git $SHA1_1 && git --git-dir=../testrepo/.git config uploadpack.allowreachablesha1inwant true && git fetch ../testrepo/.git $SHA1_1 && @@ -1251,7 +1251,7 @@ do test_must_fail git cat-file commit $SHA1_2 && git fetch ../testrepo/.git $SHA1_2 && git cat-file commit $SHA1_2 && - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ git fetch ../testrepo/.git $SHA1_3 2>err && test_i18ngrep "remote error:.*not our ref.*$SHA1_3\$" err ) @@ -1291,7 +1291,7 @@ test_expect_success 'peeled advertisements are not considered ref tips' ' git -C testrepo commit --allow-empty -m two && git -C testrepo tag -m foo mytag HEAD^ && oid=$(git -C testrepo rev-parse mytag^{commit}) && - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ git fetch testrepo $oid 2>err && test_i18ngrep "Server does not allow request for unadvertised object" err ' diff --git a/t/t5539-fetch-http-shallow.sh b/t/t5539-fetch-http-shallow.sh index b4ad81f006..c0d02dee89 100755 --- a/t/t5539-fetch-http-shallow.sh +++ b/t/t5539-fetch-http-shallow.sh @@ -69,7 +69,7 @@ test_expect_success 'no shallow lines after receiving ACK ready' ' test_commit new-too && # 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_TRACE_PACKET="$TRASH_DIRECTORY/trace" GIT_TEST_PROTOCOL_VERSION=0 \ 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 4c970787b0..23be8ce92d 100755 --- a/t/t5541-http-push-smart.sh +++ b/t/t5541-http-push-smart.sh @@ -49,7 +49,7 @@ test_expect_success 'no empty path components' ' # 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" + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 then check_access_log exp fi @@ -135,7 +135,7 @@ EOF test_expect_success 'used receive-pack service' ' # 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" + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 then check_access_log exp fi diff --git a/t/t5551-http-fetch-smart.sh b/t/t5551-http-fetch-smart.sh index e38e543867..6788aeface 100755 --- a/t/t5551-http-fetch-smart.sh +++ b/t/t5551-http-fetch-smart.sh @@ -43,7 +43,7 @@ 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_TEST_PROTOCOL_VERSION= \ + GIT_TRACE_CURL=true GIT_TEST_PROTOCOL_VERSION=0 \ git clone --quiet $HTTPD_URL/smart/repo.git clone 2>err && test_cmp file clone/file && tr '\''\015'\'' Q Accept-Encoding: .*/> Accept-Encoding: ENCODINGS/" \ actual >actual.smudged && @@ -113,7 +113,7 @@ test_expect_success 'used upload-pack service' ' # 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" + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 then check_access_log exp fi @@ -241,7 +241,7 @@ test_expect_success 'cookies stored in http.cookiefile when http.savecookies set # 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" + if test "$GIT_TEST_PROTOCOL_VERSION" = 0 then tail -3 cookies.txt | sort >cookies_tail.txt && test_cmp expect_cookies.txt cookies_tail.txt @@ -336,7 +336,7 @@ test_expect_success 'test allowreachablesha1inwant with unreachable' ' git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" && # Some protocol versions (e.g. 2) support fetching # unadvertised objects, so restrict this test to v0. - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" ' @@ -358,7 +358,7 @@ test_expect_success 'test allowanysha1inwant with unreachable' ' git -C test_reachable.git remote add origin "$HTTPD_URL/smart/repo.git" && # Some protocol versions (e.g. 2) support fetching # unadvertised objects, so restrict this test to v0. - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + test_must_fail env GIT_TEST_PROTOCOL_VERSION=0 \ git -C test_reachable.git fetch origin "$(git rev-parse HEAD)" && git -C "$server" config uploadpack.allowanysha1inwant 1 && diff --git a/t/t5552-skipping-fetch-negotiator.sh b/t/t5552-skipping-fetch-negotiator.sh index f70cbcc9ca..a2a5e0743f 100755 --- a/t/t5552-skipping-fetch-negotiator.sh +++ b/t/t5552-skipping-fetch-negotiator.sh @@ -107,7 +107,7 @@ test_expect_success 'use ref advertisement to filter out commits' ' # The ref advertisement itself is filtered when protocol v2 is used, so # use v0. - GIT_TEST_PROTOCOL_VERSION= trace_fetch client origin to_fetch && + GIT_TEST_PROTOCOL_VERSION=0 trace_fetch client origin to_fetch && have_sent c5 c4^ c2side && have_not_sent c4 c4^^ c4^^^ ' diff --git a/t/t5700-protocol-v1.sh b/t/t5700-protocol-v1.sh index 2571eb90b7..022901b9eb 100755 --- a/t/t5700-protocol-v1.sh +++ b/t/t5700-protocol-v1.sh @@ -5,7 +5,8 @@ test_description='test git wire-protocol transition' TEST_NO_CREATE_REPO=1 # This is a protocol-specific test. -GIT_TEST_PROTOCOL_VERSION= +GIT_TEST_PROTOCOL_VERSION=0 +export GIT_TEST_PROTOCOL_VERSION . ./test-lib.sh diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh index 7478f7ab7e..4fb447a143 100755 --- a/t/t7406-submodule-update.sh +++ b/t/t7406-submodule-update.sh @@ -960,7 +960,7 @@ test_expect_success 'submodule update clone shallow submodule outside of depth' mv -f .gitmodules.tmp .gitmodules && # Some protocol versions (e.g. 2) support fetching # unadvertised objects, so restrict this test to v0. - test_must_fail env GIT_TEST_PROTOCOL_VERSION= \ + 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 && From patchwork Tue Dec 24 01:02:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 11308961 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AACD6921 for ; Tue, 24 Dec 2019 01:02:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88B5E2073A for ; Tue, 24 Dec 2019 01:02:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZbPt9tXT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726965AbfLXBCb (ORCPT ); Mon, 23 Dec 2019 20:02:31 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:40939 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfLXBCb (ORCPT ); Mon, 23 Dec 2019 20:02:31 -0500 Received: by mail-pg1-f195.google.com with SMTP id k25so9616227pgt.7 for ; Mon, 23 Dec 2019 17:02:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=69RjXz5jYMzwILVC1E7OOCuKUAAZHqTlBgG24r2rvRg=; b=ZbPt9tXTtAR5MjEDdF8nAd9E37BpTO/rEC1AQutUWoPo3FrIMHDX6enwn5y/CTCrqG 1XMOcamAL/HrPJq2hjxdAfHTRVhPSsQEtgFsiqaluuhpGbm4JDuc52gumsfA5OIYWqhZ RPoQHtP82Cz8mf53NV5WzbHskUJ283zW2FsFBU4OODfSuWTftZknZK2zyyo6MXBT+xnK d3zATj6JRvHBuEep5N7fGzfTdu3q4cgfrIPF/HleyhuFNFea0u2QwRAjSDcJUpEOZEub Ary2BbfoHeKc1+nrW6hYEKs5XUPYXIHapdxIRWF0Hgipm67WCTU14Y/XxUkKdkTtx5jT YpeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=69RjXz5jYMzwILVC1E7OOCuKUAAZHqTlBgG24r2rvRg=; b=IzVkwfPX/dgUOJ6q3o5hjlr+nfBXSrSRyZ0HkqXZpVzpl3lXIlF86M9phRFjymP9Sg FnihgwRH0sPC6kghUDugtPiK+8pb/5rVgv8pA0aH/NUZ9AU5WiBzhhoP9H3CAL6+hWxr vJ+QcShcTX8ShAw+vMq/ncjpB+rKW5buT1Bw08EcbsoejEq8SpPQb1veqWVbBpJ49ubx pfDcry/9+avBVVc4WfuAe94D7c2CjQguVFkQARyPcozGfM+lOACLHjEBGXLJAat6OqeR MfyaMb4UqzjTUaosBwKcCkqDpfwPI1g261dZrxbvkTuNBbuu8HfKxEz8Gvni9STDz8P6 z2Sw== X-Gm-Message-State: APjAAAXaG6GeYGP0yM4Uoz075WXFTCqYOp1qvdf96Ry6roJjJItl/LCq U967pW5O5Q6YtTQE3dICHv1Wi1v7 X-Google-Smtp-Source: APXvYqzOTjxso6VKj+xGrrz0316SMqrsZmrS5R0lLX47H+orKEVnJ+0qOnqltli61d47Qr2u0NWaew== X-Received: by 2002:a63:214f:: with SMTP id s15mr36071506pgm.238.1577149350477; Mon, 23 Dec 2019 17:02:30 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:cf67:1de0:170f:be65]) by smtp.gmail.com with ESMTPSA id q12sm25929297pfh.158.2019.12.23.17.02.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 17:02:30 -0800 (PST) Date: Mon, 23 Dec 2019 17:02:28 -0800 From: Jonathan Nieder To: git@vger.kernel.org Cc: Jonathan Tan , Jeff King , Jeff Hostetler Subject: [PATCH 4/5] protocol test: let protocol.version override GIT_TEST_PROTOCOL_VERSION Message-ID: <20191224010228.GG38316@google.com> References: <20191224005816.GC38316@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191224005816.GC38316@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The GIT_TEST_PROTOCOL_VERSION environment variable can be used to upgrade the version of Git protocol used in tests. If both GIT_TEST_PROTOCOL_VERSION and 'protocol.version' are set, the higher value wins. For usage within tests, these semantics are too complex. Instead, always use the value from protocol.version configuration when it is set, falling back to GIT_TEST_PROTOCOL_VERSION. This way, the envvar provides a reliable preview of what will happen if the default protocol version is changed. Signed-off-by: Jonathan Nieder --- I'd like to remove the built-in support for GIT_TEST_PROTOCOL_VERSION altogether and replace it with support in the test harness for setting protocol.version to the specified value, but that can wait for a followup another day. protocol.c | 11 +++++------ t/README | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/protocol.c b/protocol.c index 9741f05750..d390391eba 100644 --- a/protocol.c +++ b/protocol.c @@ -17,9 +17,8 @@ static enum protocol_version parse_protocol_version(const char *value) 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); + const char *git_test_v; if (!git_config_get_string_const("protocol.version", &value)) { enum protocol_version version = parse_protocol_version(value); @@ -28,19 +27,19 @@ enum protocol_version get_protocol_version_config(void) die("unknown value for config 'protocol.version': %s", value); - retval = version; + return version; } + git_test_v = getenv(git_test_k); if (git_test_v && *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 env; } - return retval; + return protocol_v0; } enum protocol_version determine_protocol_version_server(void) diff --git a/t/README b/t/README index caa125ba9a..9afd61e3ca 100644 --- a/t/README +++ b/t/README @@ -352,8 +352,8 @@ 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_PROTOCOL_VERSION=, when set, makes 'protocol.version' +default to n. GIT_TEST_FULL_IN_PACK_ARRAY= exercises the uncommon pack-objects code path where there are more than 1024 packs even if From patchwork Tue Dec 24 01:04:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Nieder X-Patchwork-Id: 11308963 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC373921 for ; Tue, 24 Dec 2019 01:04:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BC3B62073A for ; Tue, 24 Dec 2019 01:04:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="XVGmYzUd" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726928AbfLXBES (ORCPT ); Mon, 23 Dec 2019 20:04:18 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:39703 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726865AbfLXBES (ORCPT ); Mon, 23 Dec 2019 20:04:18 -0500 Received: by mail-pg1-f193.google.com with SMTP id b137so9624557pga.6 for ; Mon, 23 Dec 2019 17:04:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=a7MNuE//RoXYPqcP2Z6if9LKbiq1IhHPYdUXMJq+060=; b=XVGmYzUdw4zLpBmYyTP+xZB0VvwNrKaJszE+Y9j8KMi9KeftMB9Nmz9csaoSNcsxQp coZ8fMSLWcxQh7cJwujXyhlHwIdbhog2tuAhbxnstw6A9B0eXWe39J8aHy14a/EUaC27 e0jaM6oR5/F7N+dKi48K6ul+KFYI0zf4oLhDRNQPr5YqlPMeBd7Gj729dmXNNTJRqFwm jk/+ay27JpC/GFGvq6/W+qYlJ8GFW8zLispyFTSmJmHWjbH1AyCx2UiVeQH9KhiKFHrA k9MBL5lB/LGXP3WC5JW4mSVP6cfEZ0wQAdQH9xwxqohWy7yBle6AT4wvMXyoziMEoIUX IRbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=a7MNuE//RoXYPqcP2Z6if9LKbiq1IhHPYdUXMJq+060=; b=Ia90TsaZw6l7LtqVqEb0N8L45HCWzSk4GCU23CzZBi+7AjYaf4KnqQj9h+hL3wgZxt m/UmtyaO4ao6LCShrSpU8r++xYjJRISWdDOLsaoDXZB0Vd8jqYfR4Dwv+4z0ZjuhWxpE /DPj+uBp45SaaITt6pdBGSrIx7st89ScZRHxO+H6yskUeA6YyXTsC4bqGnIhlgx31dQu paJyFvaMcZxudNawneE1VcbUE35leDXxfrIuZ7GwHtMdJm/jvKL9NsUIe02gfvwzRTQ2 J9mNVxVwAbyth7o0JSOK3u6mKW060eaeAnXaAfSt6xNXxJ1mdGRQT4bWyDE0Z/xN0GQp z1Ow== X-Gm-Message-State: APjAAAX4C3i19uMrNqkfK00+HM0n5tVhQmH00W4we9PmBxuAjxFkPZav VI9+gTgiAD1j1TWxA8aL0gXHlnfZ X-Google-Smtp-Source: APXvYqzlObBrvuKaezSdobFziK3zyCVMcQ/E0a595IL7UuPbXu/rZ0KtAKMccpnWd+4ZuxXE7yRg/w== X-Received: by 2002:a63:184d:: with SMTP id 13mr34226967pgy.132.1577149457579; Mon, 23 Dec 2019 17:04:17 -0800 (PST) Received: from google.com ([2620:15c:2ce:200:cf67:1de0:170f:be65]) by smtp.gmail.com with ESMTPSA id w123sm7453846pfb.167.2019.12.23.17.04.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Dec 2019 17:04:17 -0800 (PST) Date: Mon, 23 Dec 2019 17:04:15 -0800 From: Jonathan Nieder To: git@vger.kernel.org Cc: Jonathan Tan , Jeff King , Jeff Hostetler Subject: [PATCH 5/5] fetch: default to protocol version 2 Message-ID: <20191224010415.GH38316@google.com> References: <20191224005816.GC38316@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191224005816.GC38316@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The Git users at $DAYJOB have been using protocol v2 as a default for ~1.5 years now and others have been also reporting good experiences with it, so it seems like a good time to bump the default version. It produces a significant performance improvement when fetching from repositories with many refs, such as https://chromium.googlesource.com/chromium/src. This only affects the client, not the server. (The server already defaults to supporting protocol v2.) The protocol change is backward compatible, so this should produce no significant effect when contacting servers that only speak protocol v0. Signed-off-by: Jonathan Nieder --- That's the end of the series. Thanks for reading. Thoughts? Documentation/config/protocol.txt | 2 +- protocol.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/config/protocol.txt b/Documentation/config/protocol.txt index 0b40141613..756591d77b 100644 --- a/Documentation/config/protocol.txt +++ b/Documentation/config/protocol.txt @@ -48,7 +48,7 @@ protocol.version:: If set, clients will attempt to communicate with a server using the specified protocol version. If the server does not support it, communication falls back to version 0. - If unset, the default is `0`. + If unset, the default is `2`. Supported versions: + -- diff --git a/protocol.c b/protocol.c index d390391eba..803bef5c87 100644 --- a/protocol.c +++ b/protocol.c @@ -39,7 +39,7 @@ enum protocol_version get_protocol_version_config(void) return env; } - return protocol_v0; + return protocol_v2; } enum protocol_version determine_protocol_version_server(void)