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

Re: "disabling bitmap writing, as some objects are not being packed"?

From
Jeff King <peff@peff.net>
Date
Dec 16, 2016, 21:49 UTC
Message-ID
<20161216214906.z53yp2x4n6hdc27m@sigill.intra.peff.net>
In-Reply-To
<1481924416.28176.19.camel@frank>
On Fri, Dec 16, 2016 at 04:40:16PM -0500, David Turner wrote:
Show 11 quoted lines
> I would assume, based on the documentation, that auto gc would be doing
> an all-into-one repack:
> "If the number of packs exceeds the value of gc.autopacklimit, then
>  existing packs (except those marked with a .keep file) are
>  consolidated into a single pack by using the -A option of git
>  repack."
> 
> I don't have any settings that limit the size of packs, either.  And a
> manual git repack -a -d creates only a single pack.  Its loneliness
> doesn't last long, because pretty soon a new pack is created by an
> incoming push.
The interesting code is in need_to_gc():
        /*
         * If there are too many loose objects, but not too many
         * packs, we run "repack -d -l".  If there are too many packs,
         * we run "repack -A -d -l".  Otherwise we tell the caller
         * there is no need.
         */
        if (too_many_packs())
                add_repack_all_option();
        else if (!too_many_loose_objects())
                return 0;

So if you have (say) 10 packs and 10,000 objects, we'll incrementally pack those objects into a single new pack.

I never noticed this myself because we do not use auto-gc at GitHub at all. We only ever do a big all-into-one repack.

> Unless this just means that some objects are being kept loose (perhaps
> because they are unreferenced)? 

If they're unreferenced, they won't be part of the new pack. You might accumulate loose objects that are ejected from previous packs, which could trigger auto-gc to do an incremental pack (even though it wouldn't be productive, because they're unreferenced!). You may also get them from pushes (small pushes will be exploded into loose objects by default).

-Peff
Previous: David TurnerNext: David Turner
Message 6 of 21 in “"disabling bitmap writing, as some objects are not being packed"?”
  1. David TurnerDec 16, 2016
  2. Jeff KingDec 16, 2016
  3. Junio C HamanoDec 16, 2016
  4. Jeff KingDec 16, 2016
  5. David TurnerDec 16, 2016
  6. Jeff KingDec 16, 2016
  7. pack-objects: don't warn about bitmaps on incremental packDavid Turner, Dec 16, 2016
  8. Jeff KingDec 17, 2016
  9. David TurnerDec 19, 2016
  10. Duy NguyenDec 17, 2016
  11. David TurnerFeb 8, 2017
  12. Duy NguyenFeb 8, 2017
  13. David TurnerFeb 8, 2017
  14. Duy NguyenFeb 8, 2017
  15. Junio C HamanoFeb 8, 2017
  16. David TurnerFeb 8, 2017
  17. Jeff KingFeb 8, 2017
  18. David TurnerFeb 8, 2017
  19. Jeff KingFeb 8, 2017
  20. Junio C HamanoFeb 9, 2017
  21. Jeff KingFeb 9, 2017

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.