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

Re: [PATCH v3 0/7] builtin/maintenance: implement missing tasks compared to git-gc(1)

From
Patrick Steinhardt <ps@pks.im>
Date
May 5, 2025, 07:32 UTC
Message-ID
<aBhpn3q-sgm3WjR6@pks.im>
In-Reply-To
<xmqqo6wau3fz.fsf@gitster.g>
On Fri, May 02, 2025 at 02:07:28PM -0700, Junio C Hamano wrote:
Show 37 quoted lines
> Derrick Stolee <stolee@gmail.com> writes:
> 
> > On 5/2/2025 4:43 AM, Patrick Steinhardt wrote:
> >
> >> Changes in v3:
> >>   - Simplify the heuristic for "rerere-gc" so that we only count the
> >>     number of directory entries in ".git/rr-cache", without considering
> >>     staleness.
> >
> > The range-diff was harder to read than just re-reviewing patch 7, but I
> > think this v3 is ready to go.
> 
> I still do not think "configurable 'rerere gc' basing the decision
> on the number of existing rerere entries" adds negative value to the
> system.  If there is truly more than N active rerere entries
> currently in your repository with your workflow, such a
> configuration essentially decides to run 'rerere gc' every time (and
> without pruning enough entries to make the next 'rerere gc'
> unnecessary), and never otherwise.  It is not like pruning unneeded
> loose object files and packing the rest into a packfile, where
> running it once (even if it resulted in miniscule packfile due to
> misidentification) would remove all the loose object files, which
> makes 'repack' unneeded for some time until we accumulate more of
> them.  After 'rerere gc', you still will have rerere entries kept.
> 
> Until we can implement a meaningful automation (which may require
> changing the way rerere entries are stored on disk to help us
> cheaply tell if there truly are excessive number of no longer
> relevant rerere entries; code that we can readily borrow from
> "rerere gc" is enough, as I said), I do not think we should add
> extra code to make such a useless decision.  Instead, I would prefer
> to see a single "do we or do we not run `rerere gc`?" Boolean, until
> that happens.
> 
> Other than that, I think the series is a good addition to the
> system.  Giving finer grained control is great, and 'git maintenance'
> is a much better framework than 'git gc' to do so.

Ok, fair enough. I'll stick with the "maintenance.rerere-gc.auto" config as integer, but will adapt it so that any positive value will cause us to invoke `git rerere gc` when the "rr-cache" directory exists and has at least one entry.

The reason I want to keep it as an integer is mostly to stay consistent with all the other "maintenance.*.auto" settings, even though it does not add a lot of value right now.

Patrick
Previous: Junio C Hamano
Message 15 of 15 in “builtin/maintenance: implement missing tasks compared to git-gc(1)”
  1. 0/7 builtin/maintenance: implement missing tasks compared to git-gc(1)Patrick Steinhardt, May 2, 2025
  2. 1/7 builtin/gc: fix indentation of `cmd_gc()` parametersPatrick Steinhardt, May 2, 2025
  3. 2/7 builtin/gc: remove global variables where it trivial to doPatrick Steinhardt, May 2, 2025
  4. 3/7 builtin/gc: move pruning of worktrees into a separate functionPatrick Steinhardt, May 2, 2025
  5. 4/7 worktree: expose function to retrieve worktree namesPatrick Steinhardt, May 2, 2025
  6. Eric SunshineMay 5, 2025
  7. Patrick SteinhardtMay 7, 2025
  8. 5/7 builtin/maintenance: introduce "worktree-prune" taskPatrick Steinhardt, May 2, 2025
  9. Eric SunshineMay 5, 2025
  10. Patrick SteinhardtMay 7, 2025
  11. 6/7 builtin/gc: move rerere garbage collection into separate functionPatrick Steinhardt, May 2, 2025
  12. 7/7 builtin/maintenance: introduce "rerere-gc" taskPatrick Steinhardt, May 2, 2025
  13. Derrick StoleeMay 2, 2025
  14. Junio C HamanoMay 2, 2025
  15. Patrick SteinhardtMay 5, 2025

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.