From: Brandon Casey Date: Thu, 08 May 2008 21:40:20 GMT Subject: Re: git gc & deleted branches Message-ID: <48237344.6070405@nrlssc.navy.mil> In-Reply-To: <20080508213107.GA1016@sigill.intra.peff.net> Jeff King wrote: > On Thu, May 08, 2008 at 04:23:53PM -0500, Brandon Casey wrote: > >>> I thought that -A would eventually put them all into a single pack, >>> killing off the old packs. >> '-a' puts everything in a single pack and kills off old packs. Anything that >> was unreachable is not repacked in the new pack. >> >> '-A' does the same thing but it also repacks the unreachable objects that were >> previously packed. > > Ah, indeed. I hadn't looked closely at the -A behavior before. So yes, > we are never killing off prunable packed objects. Probably we could use > the same solution as "git prune --expire"; perhaps a > "--keep-unreachable=2.weeks.ago"? The 'prune --expire' behavior is based on object mtime (i.e. file modification time). That is lost once something is packed right? I was thinking that either repack or pack-objects could be modified to unpack those unreachable objects and leave them loose, and also give them the timestamp of the pack file they came from. Then the --expire behavior of git-prune could work normally and remove them. This seems like it would work nicely since prune follows repack in git-gc. -brandon