Teach receive-pack how to keep pack files based on object count.
commitfc04c412d8d2412e97bb2a664a1746e333dfd9ae
authorShawn Pearce <spearce@spearce.org>
Wed, 1 Nov 2006 22:06:21 +0000 (1 17:06 -0500)
committerJunio C Hamano <junkio@cox.net>
Fri, 3 Nov 2006 08:24:07 +0000 (3 00:24 -0800)
tree9aa24c52b0571079e2c53910e1d8105c6e6ca005
parentbed006fbddf919eed81cf62954e0332a395bf035
Teach receive-pack how to keep pack files based on object count.

Since keeping a pushed pack or exploding it into loose objects
should be a local repository decision this teaches receive-pack
to decide if it should call unpack-objects or index-pack --stdin
--fix-thin based on the setting of receive.unpackLimit and the
number of objects contained in the received pack.

If the number of objects (hdr_entries) in the received pack is
below the value of receive.unpackLimit (which is 5000 by default)
then we unpack-objects as we have in the past.

If the hdr_entries >= receive.unpackLimit then we call index-pack and
ask it to include our pid and hostname in the .keep file to make it
easier to identify why a given pack has been kept in the repository.

Currently this leaves every received pack as a kept pack.  We really
don't want that as received packs will tend to be small.  Instead we
want to delete the .keep file automatically after all refs have
been updated.  That is being left as room for future improvement.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Documentation/config.txt
cache.h
receive-pack.c
sha1_file.c