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

Re: People unaware of the importance of "git gc"?

From
Steven Grimm <koreth@midwinter.com>
Date
Sep 5, 2007, 08:50 UTC
Message-ID
<46DE6DBC.30704@midwinter.com>
In-Reply-To
<20070905074206.GA31750@artemis.corp>
Pierre Habouzit wrote:
Show 7 quoted lines
>   Well independently from the fact that one could suppose that users
> should use gc on their own, the big nasty problem with repacking is that
> it's really slow. And I just can't imagine git that I use to commit
> blazingly fast, will then be unavailable for a very long time (repacks
> on my projects -- that are not as big as the kernel but still -- usually
> take more than 10 to 20 seconds each).
>   

What about kicking off a repack in the background at the ends of certain commands? With an option to disable, of course. It could run at a low priority and could even sleep a lot to avoid saturating the system's disks -- since it'd be running asynchronously there should be no problem if it takes longer to run.

Alternately, if it's possible to break the repack work up into chunks that can be executed a bit at a time, you could do a small amount of repacking very frequently (possibly still in the background) rather than the whole thing at once. I suspect the nature of a repack, where you presumably want everything loaded at once, would make that a challenge, but it might not be impossible.

On the more general question...

IMO expecting end users to regularly perform what are essentially database administration tasks (running git-gc is akin to rebuilding indexes or packing tables on a DBMS) is naive. Heck, even database administrators don't like to run database administration commands; PostgreSQL added the "autovacuum" feature precisely because manual periodic repacking (and the associated monitoring to figure out when to do it) was too annoying for developers and DBAs. But you don't have to look that far; anyone who has worked in IT can tell you horror stories of users, including developers, whose computers have slowed to a crawl because the users never bothered to defrag their hard disks. And that affects *everything* the users do, not just version control operations!

It'll get worse as better UIs and tool integration become available and git gains large numbers of users who are neither software developers nor system administrators, and wouldn't know a packfile from a hole in the ground. I'm talking web designers, graphic artists, mechanical engineers, even managers and secretaries -- all of those people are in git's ultimate target audience, even if it's not ready for them today. None of them is going to be interested in doing random housekeeping operations by hand, but they'll all appreciate a fast environment.

The fact that git sometimes stores your files individually in the .git directory and sometimes bundles them together into big archives should be an implementation detail that end-users don't have to worry about day to day; git should do the right thing to remain fast under typical usage scenarios, while leaving the plumbing exposed so people with atypical usage can get their stuff done too.

-Steve
Previous: Junio C HamanoNext: Junio C Hamano
Message 16 of 97 in “People unaware of the importance of "git gc"?”
  1. Linus TorvaldsSep 5, 2007
  2. Martin LanghoffSep 5, 2007
  3. Karl HasselströmSep 5, 2007
  4. Junio C HamanoSep 5, 2007
  5. Tomash BrechkoSep 5, 2007
  6. Johan HerlandSep 5, 2007
  7. Matthieu MoySep 5, 2007
  8. Johan HerlandSep 5, 2007
  9. David KastrupSep 5, 2007
  10. Pierre HabouzitSep 5, 2007
  11. David KastrupSep 5, 2007
  12. Matthieu MoySep 5, 2007
  13. Wincent ColaiutaSep 5, 2007
  14. Pierre HabouzitSep 5, 2007
  15. Junio C HamanoSep 5, 2007
  16. Steven GrimmSep 5, 2007
  17. Junio C HamanoSep 5, 2007
  18. Martin LanghoffSep 5, 2007
  19. Matthieu MoySep 5, 2007
  20. Johan De MessemaekerSep 5, 2007
  21. Matthieu MoySep 5, 2007
  22. Jeff KingSep 5, 2007
  23. David KastrupSep 5, 2007
  24. Pierre HabouzitSep 5, 2007
  25. NixSep 5, 2007
  26. Steven GrimmSep 5, 2007
  27. NixSep 5, 2007
  28. Nicolas PitreSep 5, 2007
  29. Junio C HamanoSep 5, 2007
  30. Nicolas PitreSep 5, 2007
  31. NixSep 5, 2007
  32. Junio C HamanoSep 5, 2007
  33. Nicolas PitreSep 5, 2007
  34. Junio C HamanoSep 5, 2007
  35. Carlos RicaSep 6, 2007
  36. David KastrupSep 6, 2007
  37. Junio C HamanoSep 5, 2007
  38. Invoke "git gc --auto" from commit, merge, am and rebase.Junio C Hamano, Sep 5, 2007
  39. Shawn O. PearceSep 6, 2007
  40. Invoke "git gc --auto" from "git add" and "git fetch"Junio C Hamano, Sep 5, 2007
  41. Johannes SchindelinSep 6, 2007
  42. Alex RiesenSep 5, 2007
  43. Russ DillSep 6, 2007
  44. Shawn O. PearceSep 6, 2007
  45. Andreas EricssonSep 6, 2007
  46. Shawn O. PearceSep 6, 2007
  47. Steven GrimmSep 6, 2007
  48. Shawn O. PearceSep 6, 2007
  49. Johannes SchindelinSep 6, 2007
  50. Junio C HamanoSep 6, 2007
  51. Linus TorvaldsSep 6, 2007
  52. Steven GrimmSep 6, 2007
  53. Subject: [PATCH] git-merge-packJunio C Hamano, Sep 6, 2007
  54. Linus TorvaldsSep 6, 2007
  55. Nicolas PitreSep 7, 2007
  56. Junio C HamanoSep 7, 2007
  57. Nicolas PitreSep 7, 2007
  58. Shawn O. PearceSep 7, 2007
  59. Junio C HamanoSep 7, 2007
  60. make sha1_file.c::matches_pack_name() available to othersJunio C Hamano, Sep 8, 2007
  61. pack-objects --repack-unpackedJunio C Hamano, Sep 8, 2007
  62. Johannes SixtSep 7, 2007
  63. Junio C HamanoSep 7, 2007
  64. Andy ParkinsSep 7, 2007
  65. Shawn O. PearceSep 7, 2007
  66. Johannes SchindelinSep 7, 2007
  67. What's so special about objects/17/ ?Ævar Arnfjörð Bjarmason, Oct 7, 2018
  68. Johannes SixtOct 7, 2018
  69. Ævar Arnfjörð BjarmasonOct 7, 2018
  70. Johannes SixtOct 7, 2018
  71. Junio C HamanoOct 8, 2018
  72. Junio C HamanoOct 7, 2018
  73. Junio C HamanoOct 7, 2018
  74. Stefan BellerOct 8, 2018
  75. Junio C HamanoOct 9, 2018
  76. Stefan BellerOct 9, 2018
  77. Junio C HamanoOct 10, 2018
  78. Stefan BellerOct 10, 2018
  79. Ævar Arnfjörð BjarmasonOct 8, 2018
  80. Junio C HamanoOct 9, 2018
  81. Stefan BellerOct 9, 2018
  82. David KastrupSep 5, 2007
  83. Govind SalinasSep 5, 2007
  84. Carl WorthSep 5, 2007
  85. Jing XueSep 5, 2007
  86. Steven GrimmSep 5, 2007
  87. NixSep 5, 2007
  88. J. Bruce FieldsSep 5, 2007
  89. Brandon CaseySep 5, 2007
  90. David KastrupSep 5, 2007
  91. J. Bruce FieldsSep 5, 2007
  92. David KastrupSep 5, 2007
  93. Mike HommeySep 5, 2007
  94. Alex RiesenSep 5, 2007
  95. Steven GrimmSep 5, 2007
  96. David KastrupSep 5, 2007
  97. Fwd: [PATCH] Invoke "git gc --auto" from "git add" and "git fetch"Govind Salinas, Sep 5, 2007

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.