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

Since gc.autodetach=1 you can end up with auto-gc on every command with no user notification

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jul 8, 2015, 12:28 UTC
Message-ID
<CACBZZX5hUr8TMRXYWRqdb1AQ=oOBpEFuoMwYHczPdHN82ceuTw@mail.gmail.com>

Someone at work came to me with the problem that they were getting the "Auto packing the repository in background for optimum performance" notice on every Git command that they ran.

This problem is a combination of two things:
 * Since Nguyễn's v1.9-rc0-2-g9f673f9 where we started running "git
gc" in the background the user hasn't seen the "There are too many
unreachable loose objects" message added back in v1.5.3.1-27-ga087cc9
 * The checkout has a lot of loose objects. So even after "git prune
--expire=2.week.ago" the .git/objects/17 directory has 317 objects.
More than 27 in that directory trigger "git gc --auto".

So it's partly a UI issue. Since the repacking is happening in the background the user never sees the message suggesting that they run "git prune".

But perhaps the heuristic of "are there more than 27 objects in .git/objects/17" could be improved, but I don't know with what exactly.

But having something fork a gc to the background on every fetch (and similar object-modifying operations) is quite sub-optimal.

Next: Duy Nguyen
Message 1 of 17 in “Since gc.autodetach=1 you can end up with auto-gc on every command with no user notification”
  1. Ævar Arnfjörð BjarmasonJul 8, 2015
  2. Duy NguyenJul 8, 2015
  3. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Aug 22, 2015
  4. Junio C HamanoAug 25, 2015
  5. Duy NguyenAug 31, 2015
  6. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Sep 13, 2015
  7. Junio C HamanoSep 14, 2015
  8. Junio C HamanoSep 14, 2015
  9. Michael HaggertySep 16, 2015
  10. Junio C HamanoSep 16, 2015
  11. Michael HaggertySep 17, 2015
  12. Duy NguyenSep 17, 2015
  13. Junio C HamanoSep 17, 2015
  14. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Sep 19, 2015
  15. Junio C HamanoSep 21, 2015
  16. gc: save log from daemonized gc --auto and print it next timeNguyễn Thái Ngọc Duy, Sep 19, 2015
  17. Junio C HamanoSep 21, 2015

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.