Re: [PATCH v13 1/6] fetch: add remote.<name>.fetchRefmap
On 12/11/2026 19:49, Junio C Hamano wrote:
Show 19 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> writes:
> >>> When remote.<name>.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.<name>.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?
Show 6 quoted lines
> 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/