]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/gc.c
Implement git gc --auto
authorJunio C Hamano <gitster@pobox.com>
Wed, 5 Sep 2007 20:01:37 +0000 (13:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 6 Sep 2007 07:08:56 +0000 (00:08 -0700)
commit2c3c4399477533329579ca6b84824ef0b125914f
tree838863b68737c2feb6bb0431d13229cd589a3d1f
parentb5ef6ac978012475660a36583b2174e9bd8188a5
Implement git gc --auto

This implements a new option "git gc --auto".  When gc.auto is
set to a positive value, and the object database has accumulated
roughly that many number of loose objects, this runs a
lightweight version of "git gc".  The primary difference from
the full "git gc" is that it does not pass "-a" option to "git
repack", which means we do not try to repack _everything_, but
only repack incrementally.  We still do "git prune-packed".  The
default threshold is arbitrarily set by yours truly to:

 - not trigger it for fully unpacked git v0.99 history;

 - do trigger it for fully unpacked git v1.0.0 history;

 - not trigger it for incremental update to git v1.0.0 starting
   from fully packed git v0.99 history.

This patch does not add invocation of the "auto repacking".  It
is left to key Porcelain commands that could produce tons of
loose objects to add a call to "git gc --auto" after they are
done their work.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-gc.c