git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: Thomas Bachem via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,  Patrick Steinhardt <ps@pks.im>,
	 Phillip Wood <phillip.wood@dunelm.org.uk>,
	 Thomas Bachem <mail@thomasbachem.com>
Subject: Re: [PATCH v2] rerere: keep a background gc from killing a rebase
Date: Fri, 04 Sep 2026 10:06:03 -0700	[thread overview]
Message-ID: <xmqqfqzp3q10.fsf@gitster.g> (raw)
In-Reply-To: <5e613735-60e2-429d-a5bb-1a4f03578604@gmail.com> (Phillip Wood's message of "Fri, 4 Sep 2026 16:21:34 +0100")

Phillip Wood <phillip.wood123@gmail.com> writes:

> Overall, this commit message is rather long and it would be helpful if 
> you could distill it to remove unnecessary and unrelated details.

Hear hear.

>> +rerere.lockTimeout::
>> +	The length of time, in milliseconds, to retry when trying to
>> +	take the rerere lock while another process holds it, typically
>> +	a background `git rerere gc`.  When the time is up, the command
>> +	warns and goes on without rerere.  Value 0 means not to retry
>> +	at all; -1 means to try indefinitely.  Default is 1000 (i.e.,
>> +	retry for 1 second).  `git rerere gc` does not retry, and
>> +	`git rerere`, `git rerere forget` and `git rerere clear` fail
>> +	instead of going on.
>
> Why do those commands fail rather than wait?

Isn't locktimeout about waiting?

After waiting enough, why should it not fail but proceed?

When there is somebody holding the lock, they acquired the lock
exactly because they did not want to see others (including
ourselves) to touch the rerere database until they are done.

The description "`git rerere gc` does not retry" is highly
questionable.  None of the others retries, either.

What makes `git rerere gc` different among all is not that it does
not retry.  It just does not insist doing a GC and instead leaves
without doing anything (and without failing).

I think this is justifyable as the actions visible to end-users of
"rerere gc" is a vague "discard old enough crufts to gain the
diskspace back" (as opposed to "I know this particular entry is old
enough and I want to see it gone right now").

Compared to that, with "git rerere forget", the end-user explicitly
says "I know the specific rerere entry i just saw reused is *wrong*
and I want to get rid of it".  If another process holding the lock
prevents it from being carried out, I'd prefer to see it fail loudly
and let me know that the entry I wanted to remove is still there (so
if I retried the same merge, I'll see the same mistaken resolution).

>> +		if (fd < 0) {
>> +			warning_errno(_("skipping rerere, unable to create '%s.lock'"),
>> +				      git_path_merge_rr(r));
>
> 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.

Very good point.

Thanks.

  parent reply	other threads:[~2026-09-04 17:06 UTC|newest]

Thread overview: 24+ 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
2026-09-04 17:06     ` Junio C Hamano [this message]
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
2026-09-14  8:04 ` [PATCH v4 0/2] rerere: wait for MERGE_RR.lock, and go on at a conflict Thomas Bachem via GitGitGadget
2026-09-14  8:04   ` [PATCH v4 1/2] rerere: wait for MERGE_RR.lock, and let the gc skip it Thomas Bachem via GitGitGadget
2026-09-14  8:04   ` [PATCH v4 2/2] rerere: go on at a conflict when the lock stays busy Thomas Bachem via GitGitGadget

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=xmqqfqzp3q10.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=mail@thomasbachem.com \
    --cc=phillip.wood123@gmail.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;
as well as URLs for NNTP newsgroup(s).