From: Phillip Wood <phillip.wood123@gmail.com>
To: Thomas Bachem <mail@thomasbachem.com>, phillip.wood@dunelm.org.uk
Cc: gitgitgadget@gmail.com, git@vger.kernel.org, ps@pks.im,
gitster@pobox.com
Subject: Re: [PATCH v2] rerere: keep a background gc from killing a rebase
Date: Mon, 7 Sep 2026 11:07:41 +0100 [thread overview]
Message-ID: <595d0d45-7000-4c52-8430-f18ce8f99c71@gmail.com> (raw)
In-Reply-To: <CAA0xjtrkjaOC_+jhN=Vjm9e0T+iqAZeeMKx-ymVaQcLA37bm-w@mail.gmail.com>
Hi Thomas
On 04/09/2026 16:55, Thomas Bachem wrote:
> On 04/09/2026 16:21, Phillip Wood wrote:
>> With Patricks patches that's no-longer true I think. I think a better
>> motivation, as the cache is per-repository, rather than per-worktree, is
>> concurrent writers running in different worktrees.
>
> MERGE_RR is per worktree, though, and so is its lock:
>
> $ git -C linked rev-parse --git-path MERGE_RR
> /path/to/main/.git/worktrees/linked/MERGE_RR
>
> so writers in different worktrees never meet on it. What they share is
> rr-cache, which a gc in one worktree prunes under its own worktree's
> lock only. That is a gap of its own, and not one this patch closes.
Oh, I didn't realize the lock was per-worktree. So the lock "rerere gc"
takes does not actually stop another process running in a different
worktree from altering the rerere cache.
> What remains after Patrick's series is any "git rerere gc" that runs
> while a command records a conflict, from "git gc", from a maintenance
> run, or from auto maintenance once enough entries are stale. The v3
> message says it that way.
>
>> Overall, this commit message is rather long and it would be helpful if
>> you could distill it to remove unnecessary and unrelated details.
>
> Done, it is a quarter of the size now.
>
>> Why do those commands fail rather than wait?
>
> They wait like everything else, and once the time is up they fail
> instead of going on without rerere, which is all they are for. That
> way a stale lock gets the usual advice to remove it. The config text
> said otherwise, fixed.
That's good, I think I'd maybe misunderstood what the original patch was
trying to say.
>> It might be worth adding a check above here that BUG()s out if the
>> caller passes an incompatible set of flags.
>
> Added, for RERERE_NOWAIT with RERERE_LOCK_OR_DIE and for
> RERERE_READONLY with either.
>
>> A background job that the user did not explicitly start printing to the
>> terminal is rather confusing as it is likely to get mixed in with the
>> output of whatever is running in the foreground.
>
> The detached maintenance run has no terminal: daemonize() closes the
> standard descriptors and reopens them on /dev/null, so the gc's
> warning goes nowhere when it loses the lock. Where it cannot detach,
> on Windows, it runs in the foreground of the commit that started it
> and there is no race to lose. The warning the user does see is the
> foreground command's own, when it gives up waiting.
Thanks for clarifying that
Phillip
>
> Thanks,
> Thomas
next prev parent reply other threads:[~2026-09-07 10:07 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 8:31 [PATCH] rerere: keep a background gc from killing a rebase Thomas Bachem via GitGitGadget
2026-09-02 13:27 ` Phillip Wood
2026-09-02 15:07 ` Thomas Bachem
2026-09-03 13:50 ` Phillip Wood
2026-09-03 7:40 ` Patrick Steinhardt
2026-09-03 8:11 ` Thomas Bachem
2026-09-03 8:32 ` Patrick Steinhardt
2026-09-03 12:12 ` Thomas Bachem
2026-09-03 13:50 ` Phillip Wood
2026-09-04 7:44 ` [PATCH v2] " Thomas Bachem via GitGitGadget
2026-09-04 15:21 ` Phillip Wood
2026-09-04 15:55 ` Thomas Bachem
2026-09-07 10:07 ` Phillip Wood [this message]
2026-09-04 17:06 ` Junio C Hamano
2026-09-04 18:17 ` Thomas Bachem
2026-09-04 15:51 ` [PATCH v3] " Thomas Bachem via GitGitGadget
2026-09-04 19:08 ` Junio C Hamano
2026-09-05 5:41 ` Thomas Bachem
2026-09-05 16:10 ` Junio C Hamano
2026-09-06 10:29 ` Thomas Bachem
2026-09-07 7:41 ` 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=595d0d45-7000-4c52-8430-f18ce8f99c71@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=gitster@pobox.com \
--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