From: Phillip Wood Date: Fri, 13 Nov 2026 09:48:34 GMT Subject: Re: [PATCH v13 1/6] fetch: add remote..fetchRefmap Message-ID: <5125fcec-7764-416c-ab78-58cc22cd415d@gmail.com> In-Reply-To: On 12/11/2026 19:49, Junio C Hamano wrote: > 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/* >> > > 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. If we want to be able to use "remote..fetchRefmap" to specify how to map the names of fetched refs without specifying the default set of refs to fetch then I don't think we want git -c 'remote.cabal.fetchRefmap=refs/heads/*:refs/remotes/cabal/*' master feature:wip/feature to update "refs/remotes/cabal/feature" when we gave a destination for "feature" on the command line. The existing behavior is long-standing but I wonder how often people specify a destination in the commandline refspec when they pass --refmap, so would anyone really notice if we changed it? > 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]. I agree with having a separate patch to handle the cleanup, though as I said elsewhere I think we should drop patch 3 and use the combination of ".fetchRefmap" and ".fetch" to set the default behavior when there are no refspecs on the commandline. Thanks Phillip > [Reference] > > * https://lore.kernel.org/git/xmqqld7hafhy.fsf@gitster.g/