From patchwork Tue Feb 1 17:00:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12732037 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78820C433F5 for ; Tue, 1 Feb 2022 17:00:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233382AbiBARAf (ORCPT ); Tue, 1 Feb 2022 12:00:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231663AbiBARAc (ORCPT ); Tue, 1 Feb 2022 12:00:32 -0500 Received: from mail-wr1-x42d.google.com (mail-wr1-x42d.google.com [IPv6:2a00:1450:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05062C06173D for ; Tue, 1 Feb 2022 09:00:32 -0800 (PST) Received: by mail-wr1-x42d.google.com with SMTP id k18so33304927wrg.11 for ; Tue, 01 Feb 2022 09:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=NuKWdmCegZj7sPgFXXLtPw7o5rcay1//43Tf8j66vuY=; b=TCL3kWsnYOuvwap3GOSkDNrVRYO31hyfMol8IWS+qR359pM0xEFU3BW3umr0L1AXdu BRA572Q+fW2IsCOZ1vgWRYuw0uqAnUJBi1UcCPOUUb+CkKWLecM58y0A/IRs2S3+Nwot 0h/+OQc1Rcxe1qhk5+B//lk4JD50WMynE2t6LVS7Lm/12olJE+afyd5oOvhSOwbXzC7/ MYk1R2+Qhdp266PYqFaIRE9U0j9PhiWQEe/beys9fsOTTsEThPZFsUhQ2eUGCPiTx+0w pInxuuDAdhqcwP2j96o6ZZ768fwPHD2Kdh+Tj5Ae6h8057ekqN4Gi+a7nUFJV6VHdduB drqg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=NuKWdmCegZj7sPgFXXLtPw7o5rcay1//43Tf8j66vuY=; b=6L7GpTbbWRf0MqSN0MQZb+saDx91KfHXu/BRtt8P4J4JQaPfTVE4t1fqAPgIYDrDJ+ OdwL6YqYKkWr+IJRIKX7ZGlP37u1fSYXFoVdu3wy/kHQNkhpOHBK0PSpniuNuSrB7jZA dKUtLqMc51LlltXZSs/Z6SAU7z/bhxS5HMoBCHrJ8552cXp3z3/+NTZFr4mZbexZuKnA N0panFNCQVmasi9A0zFUzlhr1ZwjZG2fAI3GIPBuDWdSZz60U7LYqHLME4U2Kl2nbc5u 1eMso/Y7vpgoznmrnaiRXizVDSj13tXsnS/95nLCx+in4I9/d34k4YIOVWWndoCpTw46 bxxw== X-Gm-Message-State: AOAM532C8lGthZHJMxqsu1UbfT55BOGxlcKn+9NbLHmiF5qL14Fez75/ OjYULunTyLN2PgFeZq6/qyRbHGUbL9c= X-Google-Smtp-Source: ABdhPJxT3msjjfZ1ldLgpTa0N6SMtXM7jkiSJQGLVfiikQgjX1aPDo2m28yW5OI6PIWWFHykFsDRzg== X-Received: by 2002:a05:6000:15ca:: with SMTP id y10mr22769816wry.523.1643734830294; Tue, 01 Feb 2022 09:00:30 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k25sm2624480wms.23.2022.02.01.09.00.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 09:00:29 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 01 Feb 2022 17:00:26 +0000 Subject: [PATCH v3 1/3] repo-settings: fix checking for fetch.negotiationAlgorithm=default Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Derrick Stolee , =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7A=?= Bjarmason , Elijah Newren , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren In commit 3050b6dfc75d (repo-settings.c: simplify the setup, 2021-09-21), the branch for handling fetch.negotiationAlgorithm=default was deleted. Since this value is documented in Documentation/config/fetch.txt, restore the check for this value. Note that this change caused an observable bug: if someone sets feature.experimental=true in config, and then passes "-c fetch.negotiationAlgorithm=default" on the command line in an attempt to override the config, then the override is ignored. Fix the bug by not ignoring the value of "default". Technically, before commit 3050b6dfc75d, repo-settings would treat any fetch.negotiationAlgorithm value other than "skipping" or "noop" as a request for "default", but I think it probably makes more sense to ignore such broken requests and leave fetch.negotiationAlgorithm with the default value rather than the value of "default". (If that sounds confusing, note that "default" is usually the default value, but when feature.experimental=true, "skipping" is the default value.) Signed-off-by: Elijah Newren --- repo-settings.c | 2 ++ t/t5500-fetch-pack.sh | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/repo-settings.c b/repo-settings.c index 00ca5571a1a..38c10f9977b 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -85,6 +85,8 @@ void prepare_repo_settings(struct repository *r) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING; else if (!strcasecmp(strval, "noop")) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_NOOP; + else if (!strcasecmp(strval, "default")) + r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT; } /* diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index f0dc4e69686..666502ed832 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -927,7 +927,8 @@ test_expect_success 'fetching deepen' ' ) ' -test_expect_success 'use ref advertisement to prune "have" lines sent' ' +test_negotiation_algorithm_default () { + test_when_finished rm -rf clientv0 clientv2 && rm -rf server client && git init server && test_commit -C server both_have_1 && @@ -946,7 +947,7 @@ test_expect_success 'use ref advertisement to prune "have" lines sent' ' rm -f trace && cp -r client clientv0 && GIT_TRACE_PACKET="$(pwd)/trace" git -C clientv0 \ - fetch origin server_has both_have_2 && + "$@" fetch origin server_has both_have_2 && grep "have $(git -C client rev-parse client_has)" trace && grep "have $(git -C client rev-parse both_have_2)" trace && ! grep "have $(git -C client rev-parse both_have_2^)" trace && @@ -954,10 +955,20 @@ test_expect_success 'use ref advertisement to prune "have" lines sent' ' rm -f trace && cp -r client clientv2 && GIT_TRACE_PACKET="$(pwd)/trace" git -C clientv2 -c protocol.version=2 \ - fetch origin server_has both_have_2 && + "$@" fetch origin server_has both_have_2 && grep "have $(git -C client rev-parse client_has)" trace && grep "have $(git -C client rev-parse both_have_2)" trace && ! grep "have $(git -C client rev-parse both_have_2^)" trace +} + +test_expect_success 'use ref advertisement to prune "have" lines sent' ' + test_negotiation_algorithm_default +' + +test_expect_success 'same as last but with config overrides' ' + test_negotiation_algorithm_default \ + -c feature.experimental=true \ + -c fetch.negotiationAlgorithm=default ' test_expect_success 'filtering by size' ' From patchwork Tue Feb 1 17:00:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12732038 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 70B64C433EF for ; Tue, 1 Feb 2022 17:00:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230471AbiBARAf (ORCPT ); Tue, 1 Feb 2022 12:00:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233120AbiBARAd (ORCPT ); Tue, 1 Feb 2022 12:00:33 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC983C06173B for ; Tue, 1 Feb 2022 09:00:32 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id m13-20020a05600c3b0d00b00353951c3f62so1953498wms.5 for ; Tue, 01 Feb 2022 09:00:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=ASn63U8F+OkDGGw5wemyJAhE/Gh5KOJXeDjOG5jAW0s=; b=kbuJAB21tROchNUeCO/1TGDs+Q4Bu3D6qq4yBo7tn6Lj64jAUDEIzaNNgxIWMR69Im h9MSCirqZqp12e2PCwciiFeKRhrGYY3VrVjX+jUvZwIH3sV4xn+F/VeuiwvcLWbmKN08 nGClboKICthO96HUIFi35ZGWPv4aVCHtd4lZbFJ+YOyweAVWNqxubiHAbD6NM3x8zCSG w7vpVgwjlaqOuMDvwzx6IlQP4fSrW/u9js5YacM1+dj5C+4lAJShoHTKK7KD2ZAU9p7z MRYOl7f+dvgh7YiaVQMCzey17rdeszvqhpqQMLh+DSFN6Mhp+yhlHc4cIQCeT5aTBWhw 5oYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=ASn63U8F+OkDGGw5wemyJAhE/Gh5KOJXeDjOG5jAW0s=; b=Z0o9aZ7tToUVosqYHgDDSAIx9zZORdtipaZrKLsI1+PtlYBjcGzUBnbeD64fJFe69u iolBhlJxZEH+gtezmCgYGx+cr5bny8OrNjxSZunUDB0UFwVjnWzmA59vyd8PRoi+vdTS WiFHqt9eX2+DBAe/PZY64zfQ3Q+zMYe76uJWVfVktKLm/tfFUOxY6xS3mOJGaSriBGax mXIRE8p6zfs33XpNJ8Brf0BnlduqW16M6qFV+UJYIADwDeAg87TvIfg5u5q4X8/zTalL hUB+Z1WntxgjeTNoBqIqxi6CgFYwgasKpWOxGcHyYF5xhdkQSSpuXIFRjYygl//YLUBo 5M4g== X-Gm-Message-State: AOAM530yxGAt6R1amwP+QvSD01WGM6qpFqhaw2m7pz9+jbrEOT/yjZWh svPCAcONDT3sn55jUec0g0RwyqTSJ3c= X-Google-Smtp-Source: ABdhPJxi4DD5fhwHFvff24IqR+3P9IKRyZX5je6U0i7rGmz1HclpsSZS3NI6r3uMWH0xeadjmn0P2g== X-Received: by 2002:a05:600c:1988:: with SMTP id t8mr2562759wmq.66.1643734831271; Tue, 01 Feb 2022 09:00:31 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id d7sm20619855wri.117.2022.02.01.09.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 09:00:30 -0800 (PST) Message-Id: <23f692b81be26072f44609df8c78d1b8d81f01d3.1643734828.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 01 Feb 2022 17:00:27 +0000 Subject: [PATCH v3 2/3] repo-settings: fix error handling for unknown values Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Derrick Stolee , =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7A=?= Bjarmason , Elijah Newren , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren In commit af3a67de01 ("negotiator: unknown fetch.negotiationAlgorithm should error out", 2018-08-01), error handling for an unknown fetch.negotiationAlgorithm was added with the code die()ing. This was also added to the documentation for the fetch.negotiationAlgorithm option, to make it explicit that the code would die on unknown values. This behavior was lost with commit aaf633c2ad ("repo-settings: create feature.experimental setting", 2019-08-13). Restore it so that the behavior again matches the documentation. Signed-off-by: Elijah Newren --- repo-settings.c | 2 ++ t/t5500-fetch-pack.sh | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/repo-settings.c b/repo-settings.c index 38c10f9977b..41e1c30845f 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -87,6 +87,8 @@ void prepare_repo_settings(struct repository *r) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_NOOP; else if (!strcasecmp(strval, "default")) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT; + else + die("unknown fetch negotiation algorithm '%s'", strval); } /* diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 666502ed832..41ea9f25de6 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -971,6 +971,13 @@ test_expect_success 'same as last but with config overrides' ' -c fetch.negotiationAlgorithm=default ' +test_expect_success 'ensure bogus fetch.negotiationAlgorithm yields error' ' + test_when_finished rm -rf clientv0 && + cp -r client clientv0 && + test_must_fail git -C clientv0 --fetch.negotiationAlgorithm=bogus \ + fetch origin server_has both_have_2 +' + test_expect_success 'filtering by size' ' rm -rf server client && test_create_repo server && From patchwork Tue Feb 1 17:00:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elijah Newren X-Patchwork-Id: 12732039 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDA43C433EF for ; Tue, 1 Feb 2022 17:00:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235167AbiBARAi (ORCPT ); Tue, 1 Feb 2022 12:00:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231854AbiBARAe (ORCPT ); Tue, 1 Feb 2022 12:00:34 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBFCEC061714 for ; Tue, 1 Feb 2022 09:00:33 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id v13so33193275wrv.10 for ; Tue, 01 Feb 2022 09:00:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=4CxSlU+kep9DX1zZYLemJZjbA+nBm6S4um3lY3Er1yw=; b=K+mTRfEligFBxXsv2+qTcEbXXSPAc750D+e57UfL05bhpz3iYBiqHQIOIXHIgoo7+z pGKh09eVrsFPBp3OC0b5sH3z/3K3a7tg7hH/M+q7Ruty/XiTNhaqHD184Uo2xm6TQTrZ 3NRF8tLhHw8jwu4PeOyw9Q30wPxRk1E1CqzPXboss3Qa3kknDL8XD1IJa21u25x6W3rS /jsjSL7x5QXhdxKkcd0pAqnwugwr18xcbKHuknWvOmFpym4auW2Qi7yFC+E+6XLksmpN JXDmcn9TI7nmfQkROAIq8NBaXSYYRIic7gQekyJUc8G+0KYbdCMGaPFP3Q8QU0RGBkO8 Hm0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=4CxSlU+kep9DX1zZYLemJZjbA+nBm6S4um3lY3Er1yw=; b=NlG2bemzj8SG61w7LaIgGB4wmKXbQlCkPTfXokK9L6UTx3KQJhfHHpkDQoTq9k4vj7 jZQoP+VUEmEfja8KvLp9Imp57bvquVLLn1bvRhijlM/h06Kze6oQDKsuANvDx+YMZvlB N4kx5g+WFp7NcZzjb1RoPbYyybqaFUwZXhIVdxPf4eKN26/a7jUsR7YOKgLtxQnDrl+B Fxx8MO+PygK4yZMDk7fxaDCfPFHo+qc1zc+3yIqsJ9BrevUyfeytbfeMgZX8JKE7cVxt AhmzeiAY+KImGjadHk3TqbKO289K4iMDhI3GvzqDMdLk/5NQK0yEPjaOGzbvIshxyWDU dYNA== X-Gm-Message-State: AOAM530+fNyVDbT8U/J3Ti9CTek3Ht9eOPia3dsqTQhBo7pkmxszI9T/ 5wPKt0h0M5msRpx75ljFv9i6Aabnq/U= X-Google-Smtp-Source: ABdhPJzVi1T/eR+sFIKtPiFexDDUqaXNMK7woiJjkls6xwTrfGRa14+C3ZPKBvFoc8/bxHlMOWkDyQ== X-Received: by 2002:a5d:4dd0:: with SMTP id f16mr22076364wru.39.1643734832225; Tue, 01 Feb 2022 09:00:32 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id t14sm2616755wmq.43.2022.02.01.09.00.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Feb 2022 09:00:31 -0800 (PST) Message-Id: <7b28c527a907c81c3d3d8a6a54d5c713cef4f2a0.1643734828.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 01 Feb 2022 17:00:28 +0000 Subject: [PATCH v3 3/3] repo-settings: name the default fetch.negotiationAlgorithm 'consecutive' Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Derrick Stolee , =?utf-8?b?w4Z2YXIgQXJuZmrDtnI=?= =?utf-8?b?w7A=?= Bjarmason , Elijah Newren , Elijah Newren , Elijah Newren Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Elijah Newren From: Elijah Newren Give the default fetch.negotiationAlgorithm the name 'consecutive' and update the documentation accordingly. Since there may be some users using the name 'default' for this behavior, retain that name for now. We do not want to use that name indefinitely, though, because if 'skipping' becomes the default, then the "default" behavior will not be the default behavior, which would be confusing. Signed-off-by: Elijah Newren --- Documentation/config/fetch.txt | 21 ++++++++++----------- fetch-negotiator.c | 2 +- repo-settings.c | 7 ++++--- repository.h | 2 +- t/t5500-fetch-pack.sh | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Documentation/config/fetch.txt b/Documentation/config/fetch.txt index 63748c02b72..926bcfd8b48 100644 --- a/Documentation/config/fetch.txt +++ b/Documentation/config/fetch.txt @@ -56,17 +56,16 @@ fetch.output:: OUTPUT in linkgit:git-fetch[1] for detail. fetch.negotiationAlgorithm:: - Control how information about the commits in the local repository is - sent when negotiating the contents of the packfile to be sent by the - server. Set to "skipping" to use an algorithm that skips commits in an - effort to converge faster, but may result in a larger-than-necessary - packfile; or set to "noop" to not send any information at all, which - will almost certainly result in a larger-than-necessary packfile, but - will skip the negotiation step. - The default is "default" which instructs Git to use the default algorithm - that never skips commits (unless the server has acknowledged it or one - of its descendants). If `feature.experimental` is enabled, then this - setting defaults to "skipping". + Control how information about the commits in the local repository + is sent when negotiating the contents of the packfile to be sent by + the server. Set to "consecutive" to use an algorithm that walks + over consecutive commits checking each one. Set to "skipping" to + use an algorithm that skips commits in an effort to converge + faster, but may result in a larger-than-necessary packfile; or set + to "noop" to not send any information at all, which will almost + certainly result in a larger-than-necessary packfile, but will skip + the negotiation step. The default is normally "consecutive", but + if `feature.experimental` is true, then the default is "skipping". Unknown values will cause 'git fetch' to error out. + See also the `--negotiate-only` and `--negotiation-tip` options to diff --git a/fetch-negotiator.c b/fetch-negotiator.c index 273390229fe..874797d767b 100644 --- a/fetch-negotiator.c +++ b/fetch-negotiator.c @@ -18,7 +18,7 @@ void fetch_negotiator_init(struct repository *r, noop_negotiator_init(negotiator); return; - case FETCH_NEGOTIATION_DEFAULT: + case FETCH_NEGOTIATION_CONSECUTIVE: default_negotiator_init(negotiator); return; } diff --git a/repo-settings.c b/repo-settings.c index 41e1c30845f..e984075df12 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -26,7 +26,7 @@ void prepare_repo_settings(struct repository *r) /* Defaults */ r->settings.index_version = -1; r->settings.core_untracked_cache = UNTRACKED_CACHE_KEEP; - r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT; + r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE; /* Booleans config or default, cascades to other settings */ repo_cfg_bool(r, "feature.manyfiles", &manyfiles, 0); @@ -85,8 +85,9 @@ void prepare_repo_settings(struct repository *r) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING; else if (!strcasecmp(strval, "noop")) r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_NOOP; - else if (!strcasecmp(strval, "default")) - r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT; + else if (!strcasecmp(strval, "consecutive") || + !strcasecmp(strval, "default")) + r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE; else die("unknown fetch negotiation algorithm '%s'", strval); } diff --git a/repository.h b/repository.h index 2b5cf97f31e..ca837cb9e91 100644 --- a/repository.h +++ b/repository.h @@ -20,7 +20,7 @@ enum untracked_cache_setting { }; enum fetch_negotiation_setting { - FETCH_NEGOTIATION_DEFAULT, + FETCH_NEGOTIATION_CONSECUTIVE, FETCH_NEGOTIATION_SKIPPING, FETCH_NEGOTIATION_NOOP, }; diff --git a/t/t5500-fetch-pack.sh b/t/t5500-fetch-pack.sh index 41ea9f25de6..ee6d2dde9f3 100755 --- a/t/t5500-fetch-pack.sh +++ b/t/t5500-fetch-pack.sh @@ -968,7 +968,7 @@ test_expect_success 'use ref advertisement to prune "have" lines sent' ' test_expect_success 'same as last but with config overrides' ' test_negotiation_algorithm_default \ -c feature.experimental=true \ - -c fetch.negotiationAlgorithm=default + -c fetch.negotiationAlgorithm=consecutive ' test_expect_success 'ensure bogus fetch.negotiationAlgorithm yields error' '