]> git.ipfire.org Git - thirdparty/git.git/commitdiff
gc docs: downplay the usefulness of --aggressive
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 7 Apr 2019 19:52:14 +0000 (21:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 8 Apr 2019 08:01:09 +0000 (17:01 +0900)
The existing "gc --aggressive" docs come just short of recommending to
users that they run it regularly. I've personally talked to many users
who've taken these docs as an advice to use this option, and have,
usually it's (mostly) a waste of time.

So let's clarify what it really does, and let the user draw their own
conclusions.

Let's also clarify the "The effects [...] are persistent" to
paraphrase a brief version of Jeff King's explanation at [1].

1. https://public-inbox.org/git/20190318235356.GK29661@sigill.intra.peff.net/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-gc.txt

index 37c4d26a760c8e2a0c268e6667b339e59f86617c..5e80f306e750447a50f97f0e70f40c32655a7d34 100644 (file)
@@ -39,8 +39,7 @@ OPTIONS
        space utilization and performance.  This option will cause
        'git gc' to more aggressively optimize the repository at the expense
        of taking much more time.  The effects of this optimization are
-       persistent, so this option only needs to be used occasionally; every
-       few hundred changesets or so.
+       mostly persistent. See the "AGGRESSIVE" section below for details.
 
 --auto::
        With this option, 'git gc' checks whether any housekeeping is
@@ -78,6 +77,32 @@ be performed as well.
        `.keep` files are consolidated into a single pack. When this
        option is used, `gc.bigPackThreshold` is ignored.
 
+AGGRESSIVE
+----------
+
+When the `--aggressive` option is supplied, linkgit:git-repack[1] will
+be invoked with the `-f` flag, which in turn will pass
+`--no-reuse-delta` to linkgit:git-pack-objects[1]. This will throw
+away any existing deltas and re-compute them, at the expense of
+spending much more time on the repacking.
+
+The effects of this are mostly persistent, e.g. when packs and loose
+objects are coalesced into one another pack the existing deltas in
+that pack might get re-used, but there are also various cases where we
+might pick a sub-optimal delta from a newer pack instead.
+
+Furthermore, supplying `--aggressive` will tweak the `--depth` and
+`--window` options passed to linkgit:git-repack[1]. See the
+`gc.aggressiveDepth` and `gc.aggressiveWindow` settings below. By
+using a larger window size we're more likely to find more optimal
+deltas.
+
+It's probably not worth it to use this option on a given repository
+without running tailored performance benchmarks on it. It takes a lot
+more time, and the resulting space/delta optimization may or may not
+be worth it. Not using this at all is the right trade-off for most
+users and their repositories.
+
 CONFIGURATION
 -------------