summaryrefslogtreecommitdiff
path: root/Documentation/fetch-options.txt
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2019-06-19 09:46:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-20 03:56:44 (GMT)
commitc3d6b70338d0ac93f66142873f1606277dbe589f (patch)
tree2ea41e30c1bc6f2ac70c89aebf088e3bb256ad3f /Documentation/fetch-options.txt
parentb697d92f56511e804b8ba20ccbe7bdc85dc66810 (diff)
downloadgit-c3d6b70338d0ac93f66142873f1606277dbe589f.zip
git-c3d6b70338d0ac93f66142873f1606277dbe589f.tar.gz
git-c3d6b70338d0ac93f66142873f1606277dbe589f.tar.bz2
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.txt4
1 files changed, 4 insertions, 0 deletions
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt
index 91c4775..592f391 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