From: Derrick Stolee <stolee@gmail.com>
To: Patrick Steinhardt <ps@pks.im>, git@vger.kernel.org
Cc: Thomas Bachem <mail@thomasbachem.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2 0/2] builtin/maintenance: improve heuristic for "rerere gc"
Date: Fri, 4 Sep 2026 09:51:59 -0400 [thread overview]
Message-ID: <15a488b2-b4ae-4ac8-8cb3-f06ef5bbb52b@gmail.com> (raw)
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.
> 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"
> -+ 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
next prev parent reply other threads:[~2026-09-04 13:52 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-03 9:04 [PATCH 0/2] builtin/maintenance: improve heuristic for "rerere gc" Patrick Steinhardt
2026-09-03 9:04 ` [PATCH 1/2] rerere: extract logic to determine whether entries are stale Patrick Steinhardt
2026-09-03 14:11 ` Derrick Stolee
2026-09-04 5:21 ` Patrick Steinhardt
2026-09-03 9:04 ` [PATCH 2/2] builtin/maintenance: improve heuristic for "rerere gc" Patrick Steinhardt
2026-09-03 14:19 ` Derrick Stolee
2026-09-04 5:21 ` Patrick Steinhardt
2026-09-03 12:12 ` [PATCH 0/2] " Thomas Bachem
2026-09-04 7:03 ` [PATCH v2 " Patrick Steinhardt
2026-09-04 7:03 ` [PATCH v2 1/2] rerere: extract logic to determine whether entries are stale Patrick Steinhardt
2026-09-04 7:03 ` [PATCH v2 2/2] builtin/maintenance: improve heuristic for "rerere gc" Patrick Steinhardt
2026-09-04 13:51 ` Derrick Stolee [this message]
2026-09-04 14:48 ` [PATCH v2 0/2] " Junio C Hamano
2026-09-04 16:14 ` Junio C Hamano
2026-09-04 16:53 ` Thomas Bachem
2026-09-07 6:15 ` Patrick Steinhardt
2026-09-07 6:15 ` Patrick Steinhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=15a488b2-b4ae-4ac8-8cb3-f06ef5bbb52b@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=mail@thomasbachem.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=ps@pks.im \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox