Re: [PATCH v14 1/5] fetch: add remote.<name>.fetchRefmap
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Nov 19, 2026, 20:43 UTC
- Message-ID
- <xmqq1p8gwo08.fsf@gitster.g>
- In-Reply-To
- <2111d174-9571-4eb5-82cb-92f5330ae24c@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 14 quoted lines
> 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/* cabal > > and > > git config remote.cabal.fetch master > git config remote.cabal.fetchRefmap refs/heads/*:refs/test/* > git fetch > > both fetch "master" and store it under "refs/test/master"
I thought "master" as a fetch refspec element is a short-hand of "master:" that tells the machinery not to store the fetched result anywhere (other than FETCH_HEAD that is). So the first one of the above should be how the current code (without any of Harald's code for configuration) behave, and the second one should be how the code we have been reviewing should already behave, no?
With the first line in each sample replaced with (with or without the leading '+')
git config remote.cabal.fetch +refs/heads/master:refs/heads/main
the first one should store what it grabbed in two places with the current code, and the proposed update will stop touching refs/heads/main because refmap will take precedence.
Do I understand what we agreed correctly?
Thanks.