Re: [PATCH v14 1/5] fetch: add remote.<name>.fetchRefmap
On 17/11/2026 21:06, Junio C Hamano wrote:
Show 10 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> writes:
> >>> I can buy it if the suggestion was to allow passing --no-refmap from
>>> the command line (or would --refmap="" work?) to ignore .fetchRefmap
>>> configuration, though.
>>
>> I think --refmap="" might work as --refmap overrides the config and
>> --refmap="" is the documented way to ignore the ".fetch" config.
> > Do you mean ... ignore the .fetchRefmap config (not ".fetch", which
> is used as the default for refspecs and not value to a dashed
> option)?
Yes I meant --refmap overrides .fetchRefmap
Show 5 quoted lines
> All that said, it feels much more flexible if a refspec with a
> destination (whether on the command line or in the configuration)
> simply ignores the refmap. In other words, the refmap would only
> apply to refspec entries that lack a destination, leaving elements
> with their own destination untouched.
Show 5 quoted lines
> This way, we won't have to worry about what --refmap="" means.
> > So I'm completely fine with going in that direction. The only thing
> I care about is keeping a clear one-to-one relationship between the
> configuration and the command-line option: the configuration sets the
> default, and the command-line option overrides it.
Great. So I think we'd want a preliminary patch to ignore --refmap when there is a destination on the commandline and this patch to be tweaked so that
git config remote.cabal.fetch master
git fetch --refmap=refs/heads/*:refs/test/* cabaland
git config remote.cabal.fetch master
git config remote.cabal.fetchRefmap refs/heads/*:refs/test/*
git fetchboth fetch "master" and store it under "refs/test/master"
Thanks
Phillip