Re: [PATCH v8 4/5] remote: add "git remote add --limited-fetch"
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 10, 2026, 17:16 UTC
- Message-ID
- <xmqqecdxiihc.fsf@gitster.g>
- In-Reply-To
- <2b974bbe0a1ff1f70944a2db9d996c0c283bd3fa.1791619334.git.gitgitgadget@gmail.com>
"Harald Nordgren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 21 quoted lines
> From: Harald Nordgren <haraldnordgren@gmail.com> > > A remote added the ordinary way tracks every branch it has, via a > wildcard remote.<name>.fetch refspec. That is wasteful for a remote > whose history is only worth following for the branches actually in > use locally, and it can make "git fetch" negotiate history for > branches nobody asked for. > > Give "git remote add" a --limited-fetch option that sets up > remote.<name>.refmap instead of remote.<name>.fetch, so that > "git fetch <name>" only fetches the branches already tracked, as > described in the previous commit. It is rejected together with > -t/--track or --mirror, since those already say explicitly what to > fetch. > > Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com> > --- > Documentation/git-remote.adoc | 8 +++++++- > builtin/remote.c | 28 ++++++++++++++++++++++------ > t/t5505-remote.sh | 16 ++++++++++++++++ > 3 files changed, 45 insertions(+), 7 deletions(-)
This step looks quite straight-forward and nicely done. I didn't look at the tests, though.