From: Junio C Hamano Date: Wed, 28 Oct 2026 17:42:33 GMT Subject: Re: [PATCH v10 1/5] fetch: add remote..refmap Message-ID: In-Reply-To: <241e7bbc-7144-4ebf-af76-84a06a982574@gmail.com> Phillip Wood writes: >> I was hoping that with refmap, the users can tell the system where >> to store them. As specifying a shorthand also works, >> >> [remote "cabal"] >> fetch = master >> fetch = next >> fetch = seen >> refmap = +refs/heads/*:refs/remotes/cabal/* >> >> would be an easy layout to allow adding different branches than >> having to say >> >> [remote "cabal"] >> fetch = +refs/heads/master:refs/remotes/cabal/master >> fetch = +refs/heads/next:refs/remotes/cabal/next >> fetch = +refs/heads/seen:refs/remotes/cabal/seen > > That makes sense. What should we do if "remote.cabal.refmap" exists and > "remote.cabal.fetch" contains a colon? We could just ignore that entry > but it might be better to error out. Possible alternatives include - giving fetch with dst take precedence over refmap - storing the result in two locations - error out not knowing what is the right thing to do I think the command line version, i.e. $ git fetch $URL --refmap='refs/heads/*:refs/remotes/alt/*' \ refs/heads/master:refs/remotes/origin/master \ next stores 'master' as alt/master and origin/master, and 'next' as alt/next, i.e., takes the second option. Thanks.