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

Re: dangling commits and blobs: is this normal?

From
Jeff King <peff@peff.net>
Date
Apr 22, 2009, 15:27 UTC
Message-ID
<20090422152719.GA12881@coredump.intra.peff.net>
In-Reply-To
<450196A1AAAE4B42A00A8B27A59278E70ACE0502@EXCHANGE.trad.tradestation.com>
On Tue, Apr 21, 2009 at 05:46:16PM -0400, John Dlugosz wrote:
> Immediately after doing a git gc, a git fsck --full reports dangling
> objects.  Is this normal?  What does dangling mean, if not those things
> that gc finds?

gc will leave dangling loose objects for a set expiration time (defaulting to two weeks). This makes it safe to run even if there are operations in progress that want those dangling objects, but haven't yet added a reference to them (as long as said operation takes less than two weeks).

You can also end up with dangling objects in packs. When that pack is repacked, those objects will be loosened, and then eventually expired under the rule mentioned above. However, I believe gc will not always repack old packs; it will make new packs until you have a lot of packs, and then combine them all (at least that is what "gc --auto" will do; I don't recall whether just "git gc" follows the same rule).

-Peff
Previous: John DlugoszNext: Brandon Casey
Message 2 of 21 in “dangling commits and blobs: is this normal?”
  1. John DlugoszApr 21, 2009
  2. Jeff KingApr 22, 2009
  3. Brandon CaseyApr 22, 2009
  4. Nicolas PitreApr 22, 2009
  5. Matthieu MoyApr 22, 2009
  6. Jeff KingApr 22, 2009
  7. Brandon CaseyApr 22, 2009
  8. Jeff KingApr 22, 2009
  9. Nicolas PitreApr 22, 2009
  10. Matthieu MoyApr 23, 2009
  11. Nicolas PitreApr 22, 2009
  12. Brandon CaseyApr 22, 2009
  13. Nicolas PitreApr 22, 2009
  14. Jeff KingApr 22, 2009
  15. Nicolas PitreApr 22, 2009
  16. Geert BoschApr 23, 2009
  17. Shawn O. PearceApr 23, 2009
  18. Geert BoschApr 23, 2009
  19. Matthias AndreeApr 23, 2009
  20. Nicolas PitreApr 23, 2009
  21. John DlugoszApr 22, 2009

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.