Re: [PATCH] fetch: add config to avoid fetching every branch in shallow repo
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Sep 22, 2026, 15:37 UTC
- Message-ID
- <CAHwyqnUjDJNjER2AxFXOR6G3sOJKpsXj-agzmm7410_QAFu8PQ@mail.gmail.com>
- In-Reply-To
- <15c85d2d-4fb0-427d-b52e-8e4dd958dcb9@gmail.com>
On Tue, Sep 22, 2026 at 4:53 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 15 quoted lines
> > On 22/09/2026 14:00, Harald Nordgren wrote: > >>> If it is the former then we should think > >>> how we can improve the behavior of "git remote add" in a sparse > >>> repository to prevent it adding a wildcard fetch refspec and instead > >>> setup the new remote to fetch only the branch(es) we're interested in. > >> > >> I didn't even consider that, that sounds like an interesting idea! > > > > Would you suggest we do that instead of this, or in addition to this > > fix? > > I'd say instead - if we can fix "git remote add" then the problem > shouldn't arise in the first place which is better than having an opt-in > config option that most users are probably unaware of.
That makes a lot of sense.
However, I think there is info missing on the local side that we can't get without making a network call to the newly added remote, like its branches (and default branch). How do we handle that?
Harald