diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2019-06-19 16:46:30 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-19 20:56:44 -0700 |
commit | c3d6b70338d0ac93f66142873f1606277dbe589f (patch) | |
tree | 2ea41e30c1bc6f2ac70c89aebf088e3bb256ad3f /Documentation/fetch-options.txt | |
parent | Git 2.22 (diff) | |
download | tgif-c3d6b70338d0ac93f66142873f1606277dbe589f.tar.xz |
fetch: only run 'gc' once when fetching multiple remotes
In multiple remotes mode, git-fetch is launched for n-1 remotes and the
last remote is handled by the current process. Each of these processes
will in turn run 'gc' at the end.
This is not really a problem because even if multiple 'gc --auto' is run
at the same time we still handle it correctly. It does show multiple
"auto packing in the background" messages though. And we may waste some
resources when gc actually runs because we still do some stuff before
checking the lock and moving it to background.
So let's try to avoid that. We should only need one 'gc' run after all
objects and references are added anyway. Add a new option --no-auto-gc
that will be used by those n-1 processes. 'gc --auto' will always run on
the main fetch process (*).
(*) even if we fetch remotes in parallel at some point in future, this
should still be fine because we should "join" all those processes
before this step.
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/fetch-options.txt')
-rw-r--r-- | Documentation/fetch-options.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 91c47752ec..592f391298 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -88,6 +88,10 @@ ifndef::git-pull[] Allow several <repository> and <group> arguments to be specified. No <refspec>s may be specified. +--[no-]auto-gc:: + Run `git gc --auto` at the end to perform garbage collection + if needed. This is enabled by default. + -p:: --prune:: Before fetching, remove any remote-tracking references that no |