git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git auto-repack is broken...

From
Jeff King <peff@peff.net>
Date
Dec 8, 2011, 00:49 UTC
Message-ID
<20111208004931.GB23015@sigill.intra.peff.net>
In-Reply-To
<CA+sFfMdeVoz8XU5j4hNn1qCHHzaiDi0Bw=QbbuU3cwT9mMPZOA@mail.gmail.com>
On Sat, Dec 03, 2011 at 01:42:22PM -0600, Brandon Casey wrote:
Show 10 quoted lines
> >  4. "git gc" runs "git repack -Ad", which will eject X from the pack
> >     into a loose form (because it is not becoming part of the new pack
> >     we are writing).
> 
> Actually, it is right here when the newly loosened unreferenced
> objects will be deleted.  Objects ejected from a pack _are_ given the
> timestamp of the pack they were ejected from.  So, if the pack is
> older than two weeks (90 days in your example), then so will be the
> loosened objects, and git prune will delete them when called by git
> gc.
Thanks, I didn't notice that when looking at the code.
> Decreasing gc.pruneExpire as you suggested should make it much less
> likely to run into this problem.

I'd be more comfortable with that solution if we had data on what the timestamps look like when it actually happens (e.g., an "ls -lR" listing of a repository that in practice is wanting to auto-gc too often).

> I wonder if it is worth trying to limit how often gc --auto is run to
> not be more often than gc.pruneExpire or something.  If we modified
> the timestamp that is assigned to fetched packs, maybe we could use
> the pack timestamps as an indicator of how recently git gc has run.

I'm worried you run into other corner cases, there. Like a repository which is generating new, referenced objects at a fast rate (e.g., because you're importing something) should trigger auto-gc much sooner than that, and this rule would prevent it.

-Peff
Previous: Nicolas Pitre
Message 18 of 18 in “git auto-repack is broken...”
  1. Linus TorvaldsDec 2, 2011
  2. Ævar Arnfjörð BjarmasonDec 2, 2011
  3. Linus TorvaldsDec 2, 2011
  4. Jeff KingDec 2, 2011
  5. Junio C HamanoDec 2, 2011
  6. Jeff KingDec 2, 2011
  7. Junio C HamanoDec 2, 2011
  8. Jeff KingDec 2, 2011
  9. Brandon CaseyDec 3, 2011
  10. Nicolas PitreDec 7, 2011
  11. Jeff KingDec 7, 2011
  12. Nicolas PitreDec 8, 2011
  13. Jeff KingDec 8, 2011
  14. Nicolas PitreDec 8, 2011
  15. Jeff KingDec 8, 2011
  16. Junio C HamanoDec 9, 2011
  17. Nicolas PitreDec 9, 2011
  18. Jeff KingDec 8, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.