receive/fetch: exclude .keep packs when triggering .needsgc
commit4ff42291c054b533e6081376a5ac394293ea9598
authorKyle J. McKay <mackyle@gmail.com>
Sun, 10 Dec 2017 02:52:46 +0000 (9 18:52 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sun, 10 Dec 2017 02:52:46 +0000 (9 18:52 -0800)
treec9850fd6106169ebd46745f5864893e838d41453
parent3a3fffefb9e13f88f0b169dc034cd810407ac65f
receive/fetch: exclude .keep packs when triggering .needsgc

When the pre-receive and update.sh script check to see whether or
not a "mini" garbage collection is needed, do not count ".keep"
packs.

Worst case this will end up delaying the triggering of a "mini" gc
until the next receive/fetch happens.

It simplifies the pre-receive hook code slightly and the number of
packs at which a mini garbage collection gets triggered is just an
approximation anyway.  Having it happen 1 or 2 packs earlier or
later will not make any noticeable difference in performance.

It will, however, prevent it from triggering unnecessarily when an
incoming quarantined pack ends up getting discarded because the
incoming push ultimately gets denied.

We do also tweak the perform-pre-gc-linking.sh script to keep in
sync with this change even though that script rarely ever runs.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
hooks/pre-receive
jobd/update.sh
toolbox/perform-pre-gc-linking.sh