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

Re: [PATCH v2 0/2] builtin/maintenance: improve heuristic for "rerere gc"

From
Derrick Stolee <stolee@gmail.com>
Date
Sep 4, 2026, 13:51 UTC
Message-ID
<15a488b2-b4ae-4ac8-8cb3-f06ef5bbb52b@gmail.com>
In-Reply-To
<20260904-b4-pks-maintenance-rerere-gc-heuristic-v2-0-b1691121fe1c@pks.im>
On 9/4/2026 3:03 AM, Patrick Steinhardt wrote:
> Range-diff versus v1:

Thank you for taking the time to respond to my nitpicks. I think the end result is a bit cleaner, and the patches have some more clarity, too.

Show 11 quoted lines
> 1:  343dbf1c0c ! 1:  1b0b7a7b9a rerere: extract logic to determine whether entries are stale
>     -@@ rerere.c: void rerere_gc(struct repository *r, struct string_list *rr)
>     - 		for (id.variant = 0, id.collection = rr_dir;
>     - 		     id.variant < id.collection->status_nr;
>     - 		     id.variant++) {
>     --			prune_one(&id, cutoff_resolve, cutoff_noresolve);
>     -+			if (rerere_id_is_stale(&id, cutoff_resolve, cutoff_noresolve))
>     -+				unlink_rr_item(&id);
>     - 			if (id.collection->status[id.variant])
>     - 				now_empty = 0;
>     - 		}
I like that this diff is no longer in the patch. Thanks!
> 2:  c8a52f0663 ! 2:  1ceb798cdf builtin/maintenance: improve heuristic for "rerere gc"
Show 6 quoted lines
>     -+	if (limit <= 0)
>     -+		return limit < 0;
>     ++	if (!limit)
>     ++		return 0; /* never prune */
>     ++	if (limit < 0)
>     ++		return 1; /* always prune */
The extra comments are helpful here, too!
>     -+	return rerere_gc_estimate(the_repository, limit) >= (size_t)limit;
>     ++	return rerere_gc_needed(the_repository, (size_t)limit);
This looks much cleaner, thanks!

This version LGTM. -Stolee

Previous: Patrick SteinhardtNext: Junio C Hamano
Message 12 of 17 in “builtin/maintenance: improve heuristic for "rerere gc"”
  1. 0/2 builtin/maintenance: improve heuristic for "rerere gc"Patrick Steinhardt, Sep 3, 2026
  2. 1/2 rerere: extract logic to determine whether entries are stalePatrick Steinhardt, Sep 3, 2026
  3. Derrick StoleeSep 3, 2026
  4. Patrick SteinhardtSep 4, 2026
  5. 2/2 builtin/maintenance: improve heuristic for "rerere gc"Patrick Steinhardt, Sep 3, 2026
  6. Derrick StoleeSep 3, 2026
  7. Patrick SteinhardtSep 4, 2026
  8. Thomas BachemSep 3, 2026
  9. 0/2 builtin/maintenance: improve heuristic for "rerere gc"Patrick Steinhardt, Sep 4, 2026
  10. 1/2 rerere: extract logic to determine whether entries are stalePatrick Steinhardt, Sep 4, 2026
  11. 2/2 builtin/maintenance: improve heuristic for "rerere gc"Patrick Steinhardt, Sep 4, 2026
  12. Derrick StoleeSep 4, 2026
  13. Junio C HamanoSep 4, 2026
  14. Junio C HamanoSep 4, 2026
  15. Thomas BachemSep 4, 2026
  16. Patrick SteinhardtSep 7, 2026
  17. Patrick SteinhardtSep 7, 2026

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.