From: Junio C Hamano Date: Thu, 12 Nov 2026 19:49:17 GMT Subject: Re: [PATCH v13 1/6] fetch: add remote..fetchRefmap Message-ID: In-Reply-To: <01a799bc-5493-4984-8b83-7f2aef698f85@gmail.com> Phillip Wood writes: >> When remote..fetch is also configured, it still decides what to >> fetch, and the refmap maps what it fetches. This lets a remote name >> only a few branches and store them all through one refmap: >> >> [remote "cabal"] >> fetch = master >> fetch = next >> fetch = seen >> fetchRefmap = +refs/heads/*:refs/remotes/cabal/* > > What happens if remote.cabal.fetch is a refspec and > remote.cabal.fetchRefmap is set? Good question. But "fetch = master" is a refspec already ;-), so the question needs to be clarified a bit. If .fetch is a refspec with a right hand side that stores the result somewhere, and that somewhere is different from what the .fetchRefmap suggests should happen, what happens? I think we tried earlier and saw that we store them twice [*], even without this series (i.e., specifying both refspec and refmap from the commmand line). As it is a long-standing behavior since the --refmap feature was introduced, and I do not see huge problem with that behavior, I am not sure if it is worth tweaking. But if it is wroth tweaking, we probably should do so as a preliminary clean-up before all of this, since .fetchRefmap is merely a way to allow you to avoid having to specify --refmap from the command line all the time, and this series does not change its semantics until step [3/6]. [Reference] * https://lore.kernel.org/git/xmqqld7hafhy.fsf@gitster.g/