{"thread":{"id":"42488","subject":"How to cut extra liftime of expired loose objects","startedAt":"2016-05-30T16:43:07Z","lastAt":"2016-05-30T18:53:26Z","messageCount":3,"participants":["Johannes Sixt","Jeff King","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"287830","messageId":"574C6D9B.1080200@kdbg.org","threadId":"42488","inReplyTo":null,"subject":"How to cut extra liftime of expired loose objects","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2016-05-30T16:43:07Z","receivedAt":"2016-05-30T16:43:07Z","isPatch":false,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"I think there is logic somewhere in git gc or its minions that gives \nexpired objects that have been packed a two weeks extra life time as \nloose objects.\n\nThat is, reachable loose objects are moved to a pack, but those objects \nthat were packed, but become unreachable due to expired reflogs, are \nevicted from the pack and live for another two weeks or so as loose objects.\n\nAs a consequence of this, I always have a few thousand loose objects in \nmy busy repositories, no matter how often I collect garbage. Is there a \nknob that removes the extra lease of life of objects without reducing \nthe usual expiration times of reflogs etc?\n\n-- Hannes\n"},{"id":"287839","messageId":"20160530182405.GA17253@sigill.intra.peff.net","threadId":"42488","inReplyTo":"574C6D9B.1080200@kdbg.org","subject":"Re: How to cut extra liftime of expired loose objects","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2016-05-30T18:24:06Z","receivedAt":"2016-05-30T18:24:06Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, May 30, 2016 at 06:43:07PM +0200, Johannes Sixt wrote:\n\n> I think there is logic somewhere in git gc or its minions that gives expired\n> objects that have been packed a two weeks extra life time as loose objects.\n> \n> That is, reachable loose objects are moved to a pack, but those objects that\n> were packed, but become unreachable due to expired reflogs, are evicted from\n> the pack and live for another two weeks or so as loose objects.\n\nSort of. The loose objects should get the mtime of the pack, which is\nlikely newer than 2 weeks. So it's not a 2-week extension, but it may\ntake up to 2 weeks for them to go away (and if the pack is already more\nthan 2 weeks old, the objects are dropped without even loosening).\n\n> As a consequence of this, I always have a few thousand loose objects in my\n> busy repositories, no matter how often I collect garbage. Is there a knob\n> that removes the extra lease of life of objects without reducing the usual\n> expiration times of reflogs etc?\n\ngc.pruneExpire should do this.\n\nI have run into this, too, and it interacts annoyingly with the\nbackground-gc (which complains \"you have too many objects; run\ngit-prune\", leaves that in a .lock file, and then every subsequent\nauto-gc spews it at me).\n\nI think we should consider dropping the default time to something more\nlike 1 day. The 2-week period predates reflogs, I believe (OTOH, it does\nsave objects which you might have used with \"git add\" but never actually\ncommitted).\n\n-Peff\n"},{"id":"287846","messageId":"xmqqpos38jix.fsf@gitster.mtv.corp.google.com","threadId":"42488","inReplyTo":"20160530182405.GA17253@sigill.intra.peff.net","subject":"Re: How to cut extra liftime of expired loose objects","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2016-05-30T18:53:26Z","receivedAt":"2016-05-30T18:53:26Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> I think we should consider dropping the default time to something more\n> like 1 day. The 2-week period predates reflogs, I believe (OTOH, it does\n> save objects which you might have used with \"git add\" but never actually\n> committed).\n\nYour belief is shared by me.\n"}]}