From: Harald Nordgren Date: Tue, 27 Oct 2026 12:22:25 GMT Subject: Re: [PATCH v10 0/5] fetch: avoid fetching every branch of a new remote in a shallow repo Message-ID: In-Reply-To: > > I've just read through the commit messages and documentation changes and > > I think it is a mistake to use a single config variable to configure > > where fetched refs are stored and which refs are fetched. The problem > > this series tries to solve is that the default refspec fetches all the > > branches from the remote and it's not possible to use that mapping and > > also restrict which branches are fetched. To fix that it introduces a > > new config setting to configure where the refs are stored which is good, > > but it then uses the presence of that setting to implicitly configure > > the default set of refs to fetch. To me that repeats the mistake of the > > existing fetch config. > > > > It would be much more flexible if we had a separate config setting > > (maybe remote..fetchRefs) to describe which refs are fetched. > > Good point. Ok. > When I wrote the refmap feature (without configuration variable) > long time ago, one of the goals was to allow me to say > > $ git fetch cabal \ > --refmap="+refs/heads/*:refs/remotes/cabal/*" \ > maint master next > > That is, "here is the place I grab from there are stored" and > "maint master next are the things I grab from there" are specified > separately. With the configuration variable added in this series, > > $ git config set remote.cabal.refmap "+refs/heads/*:refs/remotes/cabal/*" > $ git fetch cabal master next seen > > should become possible with the same behaviour. I am not sure > offhand if this series does that, but I would consider it a bug if > it does not. It will do that in my next version and I added a test specifically for this. Harald