🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #1490

Re: [PATCH v10 0/5] fetch: avoid fetching every branch of a new remote in a shallow repo

#1490
From: Phillip Wood
Date: Mon, 26 Oct 2026 09:43
57 lines
13811 bytes
On 24/10/2026 00:13, Junio C Hamano wrote:
> "Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
> This topic seeems fairly well done, without seeing any additional
> comments in the last two rounds, but I am highly disturbed that I
> was practically the only person who reviewd its later iterations.
> Because I am not a target audience of the feature, I would not be
> surprised if I am missing something large.
> 
> I would very much appreciate if somebody else can give the series
> one more read and Ack them, so that we can move it forward.

I've just read through the commit messages and documentation changes and 
I think it is a mistake to use a single config variable to configure 
where fetched refs are stored and which refs are fetched. The problem 
this series tries to solve is that the default refspec fetches all the 
branches from the remote and it's not possible to use that mapping and 
also restrict which branches are fetched. To fix that it introduces a 
new config setting to configure where the refs are stored which is good, 
but it then uses the presence of that setting to implicitly configure 
the default set of refs to fetch. To me that repeats the mistake of the 
existing fetch config.

It would be much more flexible if we had a separate config setting 
(maybe remote.<name>.fetchRefs) to describe which refs are fetched. That 
setting could accept something like "*@{upstream}" to "mean fetch the 
upstream branches of my local branches that live on this remote" which 
would cover what this series wants. I think it would be useful to 
support "+" and "^" prefixes on the refs to fetch as well, so that the 
refmap config controls the mapping and the "what to fetch" config 
handles negation and forced updates on a per-ref basis.

Setting

     remote.<name>.fetchRefmap refs/heads/*:refs/remotes/<name>/*
     remote.<name>.fetchRefs +refs/heads/*

would be equivalent to

     remote.<name>.fetch +refs/heads/*:refs/remotes/<name>/*

Ideally when we're seeing which refs to fetch we'd use the last entry 
that matches so that

    remote.<name>.fetchRefs +refs/head/*
    remote.<name>.fetchRefs refs/heads/master

would refuse non-fast-forward updates for master. Currently we use the 
first refspec we find that matches which goes against the usual "last 
one wins" behavior for config settings and makes it impossible to add 
per-branch refspecs with "git config" because the default setting comes 
first in the config file and matches all branches.

Thanks

Phillip
Technical Details
Message-ID: <101723fc-d392-4000-b224-345c610b2aaa@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73282-linux-kernel-git=dewy.ru
References: <pull.2412.git.git.1789829246437.gitgitgadget@gmail.com> <pull.2412.v10.git.git.1792503778.gitgitgadget@gmail.com> <xmqqcxt02eoa.fsf@gitster.g>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-73282-linux-kernel-git=dewy.ru
From: phillip.wood123@gmail.com (Phillip Wood)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH v10 0/5] fetch: avoid fetching every branch of a new
 remote in a shallow repo
Date: Mon, 26 Oct 2026 09:43:07 +0000
Organization: Usenet Network
Message-ID: <101723fc-d392-4000-b224-345c610b2aaa@gmail.com>
References: <pull.2412.git.git.1789829246437.gitgitgadget@gmail.com>
 <pull.2412.v10.git.git.1792503778.gitgitgadget@gmail.com>
 <xmqqcxt02eoa.fsf@gitster.g>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="1274759"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:t+GjElRr56YHOt4hkZ7wCbQ/2cI= sha256:eJAAmdjaLkb9/gDG84RieV/+YowxLir9xU/9nV5/a2I=
	sha1:28/tCzyLYh4ufLzYukXOjhMRVCo= sha256:tP5htg6Mx7B4gb0DRsLgB1UWY6ZQEJgV0HImUiHA7mI=
Content-Language: en-US
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 299F0125B96; Mon, 26 Oct 2026 12:50:21 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.948
X-Spam-Status: No, score=-1.948 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id S7G_siEHGwfW;
	Mon, 26 Oct 2026 12:50:18 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=git+bounces-73282-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 0B435125B92; Mon, 26 Oct 2026 12:50:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id D0EAD37249; Mon, 26 Oct 2026 09:43:29 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1793007791;
	b=RtO///amMUqBKaj5gIk3ZuNUgL0MqRMRjGXxfXABUpp7D8O9jIetUQlhv5E3aSsfUuel
	 OlW1UTLd9NEsnu2BJdIXKaa017KujI3CDUWuWANgIcpUSYNKpEW/ixx4yuXk362AWNeWc
	 OuvI9YTBsYChWpArj72NkI18POejkuH6PGP7Mbxt/oYIwQk95+sRT8pX0iBYpbBJfK9nn
	 irnfjWDHcV8ktrxlVMSqHlVN0Cr1WesF1FGuGqw5TA2AGamBREFWpsqUxa50ejeiPyUZD
	 mg+XiazgkjXUUgIlAqwquhNj+s9Csw0izUD8whXCvuHl9XgQhQ6QL9hB+eTcFihFxUw==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793007791;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
	 X-Gm-Gg:X-Received:Received:Message-ID:Date:X-Mailing-List:List-Id:
	 List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner:
	 Precedence:MIME-Version:User-Agent:Reply-To:Subject:To:Cc:References:
	 Content-Language:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=TwzvTQBZ3iRmYR4nSL+d5hZG9/B6SV8f2yZkBwbDR20=;
	b=gDjefVKTQC4FPiXF8KOXkuX2+BlJrCBJg9TsK6RHae9v6+JfaJx4SNgztP07Cz5P8TTz
	 4RWUbZNq+mFC0xMi/qtFX23XcqX/Ov6+SmpF9a7geC/lEkLGbfgvTXbuD34CB8C3943Ts
	 lQYiFWS/hGttZqMMqdtEQZO17hXvmbqyjF5KLa1+oAKdIHQUcBcg+6cLpiGVz/hBwrRE0
	 T4Dy+Lpz/p2fVA71JDfepQ6wRx4ZkTY7gn9zqQhvenDlAIjkv+DaB1HTMbVHa/oYJAk17
	 zLHEMNIL82Ul5f7XQvC/ZFlQsLX4sHXbcUj6484VNZmuZrvado6968sWm8vCpIo/Vyw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=oe4nIPZ6;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id A6666606A324;
	Mon, 26 Oct 2026 09:43:11 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=oe4nIPZ6
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.53
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793007790;
	b=nNcJGSIuncFJsYsKr5vcOdLNtjE3x58MM/kyuTkwWza8AcxFGzBBqfDSRFi8CKOOHnqz
	 NTXTcSbqXjiwpQDoBKMQXcWzO5tB1HHyxPue1fBabhaCQNXzwX6rFzwQBMBVlkkviPJJy
	 wOc5QGvolwYyiAjMV4GiApviKQf6DT/IhhrYbzI1Fe/+GB1xfjtkPehetp0HufBqfQWfY
	 87wzj8blcrt3bYnZ7ja9/g950U49dj8PHqx60ktctX3vUKNq74yD4L/QPEuBz0ATGHat7
	 Oap66f5R5jPf64apaIgKKeacTvNB/0NBbXcDhAlqWQbce/vaP0NDsuHUClpD1sAJZ3g==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793007790;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
	 Message-ID:Date:MIME-Version:User-Agent:Reply-To:Subject:To:Cc:
	 References:Content-Language:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=TwzvTQBZ3iRmYR4nSL+d5hZG9/B6SV8f2yZkBwbDR20=;
	b=eh+Q1ONx+iXds5cMumXBMpK0bHj1REH/ldpQBpz8sqj7zeVGkmMVU9gcHRq79Se//TZu
	 8nIqz78nBLNwf9o6Jf+BgjYExOTByvhsxRB034sPAttisHj6upKUaka0tDkJfZYeg4Sb/
	 FVDEHZWrwoIwZTBlEMRPT+ndYReag9TdZLm8ILZ32ZLm4m9C85+8X1/RFrhnzMfRRhOru
	 CWTMNXBNkyWvqFwC9WF4e8DOX2bh+BQ1adki5w/tr8LSWjgcZ6UnojFDLs98n7OSSOn2J
	 8bvseWmeON9GvrlJWGM4CasjjC062B7DYmt76rjXgIz0mZV84oZKjuAEWyWH5IYvvDg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=oe4nIPZ6;
	arc=none smtp.remote-ip=209.85.221.53
X-Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 756FC606A31B
	for <git@vger.kernel.org>; Mon, 26 Oct 2026 09:43:10 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 756FC606A31B
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-wr1-f53.google.com with SMTP id ffacd0b85a97d-48e0d1c095dso1596236f8f.1
        for <git@vger.kernel.org>; Mon, 26 Oct 2026 02:43:10 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1793007789; x=1793612589; darn=vger.kernel.org;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:reply-to:user-agent
         :mime-version:date:message-id:from:to:cc:subject:date:message-id
         :reply-to:content-type;
        bh=TwzvTQBZ3iRmYR4nSL+d5hZG9/B6SV8f2yZkBwbDR20=;
        b=oe4nIPZ6gqG04UiC5w8MFsxogfdqH3T2WGHcmpk89JObT6Fnp2st2GXHpKFYJzNmfq
         ynmGmAOjQs0aWg5U/ir3wtE80bDcH2yXbSEV/ogBpKPXC/CYu4xJaX2txtqg7VYTe61x
         D85TlyWVfnHL4TSzCXV1reB0Fm+fUUlnK3ea+qUSjQhzxpqGIj67Bb9drs2qp9QbvVfD
         yQ648M7vbSBzr47du42idbG5mzVXRwOrzHoUyQ6FlJiAh38p1MmJq5/78nz9YpkzEk1S
         Ghq6MHHtIO9Q4G9Ek2WtGmcYxjuUak9wXfMoUpHzXdfVgax/CxO1+Wmuil22tHetEaTg
         hqYQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1793007789; x=1793612589;
        h=content-transfer-encoding:content-type:in-reply-to:from
         :content-language:references:cc:to:subject:reply-to:user-agent
         :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=TwzvTQBZ3iRmYR4nSL+d5hZG9/B6SV8f2yZkBwbDR20=;
        b=pER1igWiFPWZycjy7Ui7RQGKUoHGWYF14zgfVFtTYHg8t2WKROnBHKKDhka/1M2e5g
         039gimszCEuTM6seYd6XV+ikA04NvFxunOB73ePk64j3bhUKR7gXudDeqMsXMqbI1XL8
         Bhqkeh9qGRWBwHR0aLi64DAMd71xiNKaoDQFcS78wMvEiSBEME2IMw1PlMnRw8HXJHtn
         ku0HAFU/6fV/a7Y2REn86+PJidLg0GTZdjfpZGkAe9ubn09ERE65IQkGPOPwlGLLwBhq
         Au+Lvjrni1gxU69l2RS5k2brdPa/XzeouoMf1ix7W+PXFXzBKdcglHLWke4niJOugTw9
         1Qww==
X-Forwarded-Encrypted: i=1; AKwUvBz07JPQQcHo2BpoCZUV2gTYlsJ7fuFmGqQ1VAXx3nds+A2LKiP3ema6OvLsCzdYQSiY0lo=@vger.kernel.org
X-Gm-Message-State: AFq9FYLR2Zu9Yf0xqAoB1dJnmdGKyzKh7401eK9GuPqL+Dg7j3WjFp4l
	Dt+5dR/YsyqCTq3DIjzLdT51/SVoDUG2wsr5VlJB5+skGNNR+ICCZkvc
X-Gm-Gg: AYBFou2Y+/dP/KkHpC9OsrsEs77xrhm2eBWUBvYabyzJfhmGb5LylUeSWmxw6puMn0q
	WDABfDolO7M2a7YovF6i5tIyLdnU1opXqkGZak/yK6NObKYroa8YZGLN8B59+NCDRca/mhQGVbD
	2ZO/vGkU5dZm/vFBckYh7pquZw15EKNQfTX9rEUETxpIp7aKFJKHpQ2YxpxIq65iNoHzr657TI0
	EBROO1IuVJ5dSbuCg70xBKWo3q0hQgOWzVFXlYc52zw2xf1zmGRQrIGluvZ2L3oab9A0Ef97sIN
	HIzXsYAICn3b2HJLGFqpS21BQGpM86AOVcpcma40mEbHPePhmbikN8Vy4fibiYh7NQ/Yzs9xZU5
	2OsOhlXsVdZm1RBO/s3bL9YAM+ioPjZVSXUnpru8SLcppwkYRj1ZJG1jsazWkF8vkrpDQ7u3ZD6
	kW4jFo8tlHW8V8DlrV4QSVJVKXAynTUEcoeDTjU0uZ/TTQiOiLoG5ELUgK+IfM+XHTO48eBwd6e
	wMVoEr1QblexU9T5AQV/fcp2sceZchPg97FRlvdJpZHUrlhY5vW1Y77QBo+XsDiAWWjlwmW4A2p
	3qTjlWC/5GiXhlNOO4qAFdlK/mue7Z4JF7D/B3ugpzxNFJ3jtI5o6Ls=
X-Received: by 2002:a05:6000:4809:b0:488:7787:469d with SMTP id ffacd0b85a97d-48e3eb8ea2emr11315002f8f.25.1793007788616;
        Mon, 26 Oct 2026 02:43:08 -0700 (PDT)
X-Received: from ?IPV6:2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f? ([2a0a:ef40:724:6601:f3ff:aebc:61f8:d91f])
        by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-48e3eb8f387sm15005024f8f.4.2026.10.26.02.43.07
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Mon, 26 Oct 2026 02:43:08 -0700 (PDT)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird
X-Reply-To: phillip.wood@dunelm.org.uk
X-Cc: Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>,
 "D. Ben Knoble" <ben.knoble@gmail.com>,
 Harald Nordgren <haraldnordgren@gmail.com>
X-In-Reply-To: <xmqqcxt02eoa.fsf@gitster.g>