gc.sh: improve loose object handling
commit9213aeb26eb58e64f777f2de8a83f7e884f70b46
authorKyle J. McKay <mackyle@gmail.com>
Sat, 30 Dec 2017 23:41:39 +0000 (30 15:41 -0800)
committerKyle J. McKay <mackyle@gmail.com>
Sat, 30 Dec 2017 23:41:39 +0000 (30 15:41 -0800)
tree72290eb6ca0f0ac48be9485475a712bb086e2560
parent350eaf81f9215751a1858e045c267cbe034b1a0c
gc.sh: improve loose object handling

In an attempt to coexist with linked working trees (and possibly
even non-bare repositories), Girocco trys to guarantee that any
unreachable loose objects persist for at least one min_gc_interval
period.  They get packed up into an _o.pack that remains until the
next full gc takes place.

However, other than at a full gc, loose objects are left alone to
accumulate endlessly.

Girocco itself normally does not generate loose objects (although
a manually configured custom external VCS mirror might do so).

Nevertheless, improve on this situation by allowing a "mini" gc to
migrate "lotsa" loose objects into a _l.pack (and potentially combine
them if there get to be too many of them).

In order to maintain the one min_gc_interval guarantee, these _l.pack
packs are treated like they were still unpacked loose objects at
full gc time.

This results in improved efficiency by avoiding accumulations of
large numbers of loose objects prior to the next full gc at very
little extra cost.  If there are no loose objects the cost is
practically zilch.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/gc.sh