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

Re: [PATCH v2 6/8] rerere: provide function to collect stale entries

From
Patrick Steinhardt <ps@pks.im>
Date
May 5, 2025, 07:22 UTC
Message-ID
<aBhnOiHgfycVJhHQ@pks.im>
In-Reply-To
<xmqqwmazug0i.fsf@gitster.g>
On Fri, May 02, 2025 at 09:35:57AM -0700, Junio C Hamano wrote:
Show 9 quoted lines
> Patrick Steinhardt <ps@pks.im> writes:
> > We could also adapt this to be closer to the original version, where we
> > only verified that ".git/rr-cache" exists and contains at least one
> > subdirectory. This can even be combined with the above approach if we
> > set "maintenance.rerere-gc.auto=1" by default.
> 
> But wouldn't that be like always running "rerere gc"?  What would
> you save by checking the existence of at least one rerere entry?
> Cost to spawn "rerere gc" as a subprocess?

What you save is executing the rerere logic in case the feature isn't enabled at all, but also in the case where you have eventually disabled the rerere cache but still have a now-empty ".git/rr-cache" directory.

> Wouldn't it be a better use of the engineering effort to libify the
> logic of that process and make it internally callable in the longer
> term (or are you already doing that in this series)?

The logic itself already is quite encapsulated, but I decided to not use it for now because we don't do so for any of the other tasks, either. But I do agree that we should eventually refactor all of our tasks so that they don't need to spawn an external process at all.

Patrick
Previous: Junio C HamanoNext: Patrick Steinhardt
Message 11 of 14 in “builtin/maintenance: implement missing tasks compared to git-gc(1)”
  1. 0/8 builtin/maintenance: implement missing tasks compared to git-gc(1)Patrick Steinhardt, Apr 30, 2025
  2. 1/8 builtin/gc: fix indentation of `cmd_gc()` parametersPatrick Steinhardt, Apr 30, 2025
  3. 2/8 builtin/gc: remove global variables where it trivial to doPatrick Steinhardt, Apr 30, 2025
  4. 3/8 builtin/gc: move pruning of worktrees into a separate functionPatrick Steinhardt, Apr 30, 2025
  5. 4/8 worktree: expose function to retrieve worktree namesPatrick Steinhardt, Apr 30, 2025
  6. 5/8 builtin/maintenance: introduce "worktree-prune" taskPatrick Steinhardt, Apr 30, 2025
  7. 6/8 rerere: provide function to collect stale entriesPatrick Steinhardt, Apr 30, 2025
  8. Junio C HamanoApr 30, 2025
  9. Patrick SteinhardtMay 2, 2025
  10. Junio C HamanoMay 2, 2025
  11. Patrick SteinhardtMay 5, 2025
  12. 7/8 builtin/gc: move rerere garbage collection into separate functionPatrick Steinhardt, Apr 30, 2025
  13. 8/8 builtin/maintenance: introduce "rerere-gc" taskPatrick Steinhardt, Apr 30, 2025
  14. Derrick StoleeApr 30, 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.