fetch: support hideRefs to speed up connectivity checks
commitc6ce27ab08d30dd9d626d7a56cb928bc5792eb27
authorEric Wong <e@80x24.org>
Sun, 12 Feb 2023 09:04:26 +0000 (12 09:04 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Feb 2023 17:27:03 +0000 (27 09:27 -0800)
treedb78da0e93422555f1e18788c91f2e5aaa64a2ff
parentdadc8e6dacb629f46aee39bde90b6f09b73722eb
fetch: support hideRefs to speed up connectivity checks

With roughly 800 remotes all fetching into their own
refs/remotes/$REMOTE/* island, the connectivity check[1] gets
expensive for each fetch on systems which lack sufficient RAM to
cache objects.

To do a no-op fetch on one $REMOTE out of hundreds, hideRefs now
allows the no-op fetch to take ~30 seconds instead of ~20 minutes
on a noisy, RAM-constrained machine (localhost, so no network latency):

   git -c fetch.hideRefs=refs \
-c fetch.hideRefs='!refs/remotes/$REMOTE/' \
fetch $REMOTE

[1] `git rev-list --objects --stdin --not --all --quiet --alternate-refs'

Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-rev-parse.txt
Documentation/rev-list-options.txt
builtin/fetch.c
builtin/rev-list.c
revision.c
t/t5510-fetch.sh
t/t6018-rev-list-glob.sh
t/t6021-rev-list-exclude-hidden.sh