Re: [PATCH v7 2/2] rerere: add "gc --skip-locked" for auto maintenance
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 13, 2026, 07:31 UTC
- Message-ID
- <as3eUhze_btZJqbJ@pks.im>
- In-Reply-To
- <000288119671bad19e5e9e37419766b364daaacc.1791627204.git.gitgitgadget@gmail.com>
On Sat, Oct 10, 2026 at 10:13:24AM +0000, Thomas Bachem via GitGitGadget wrote:
Show 23 quoted lines
> diff --git a/rerere.h b/rerere.h
> index feeb0e2c9f..61e986475b 100644
> --- a/rerere.h
> +++ b/rerere.h
> @@ -10,6 +10,8 @@ struct repository;
> #define RERERE_AUTOUPDATE 01
> #define RERERE_NOAUTOUPDATE 02
> #define RERERE_READONLY 04
> +/* If MERGE_RR.lock is taken, return -1 as if rerere were disabled */
> +#define RERERE_NOWAIT 010
>
> /*
> * Marks paths that have been hand-resolved and added to the
> @@ -37,7 +39,14 @@ const char *rerere_path(struct strbuf *buf, const struct rerere_id *,
> int rerere_forget(struct repository *, struct pathspec *);
> int rerere_remaining(struct repository *, struct string_list *);
> void rerere_clear(struct repository *, struct string_list *);
> -void rerere_gc(struct repository *, struct string_list *);
> +
> +enum rerere_gc_flags {
> + /* Skip the operation in case the MERGE_RR.lock is already taken. */
> + RERERE_GC_NOWAIT = (1 << 0),
> +};Hm. I was hoping that we could avoid introducing both RERERE_NOWAIT and RERERE_GC_NOWAIT. But seeing the result I'm way less sure about my earlier suggestion to introduce the gc-specific flags, as translating the flags is a bit awkward. I think that your version that only has the RERERE_NOWAIT flag was better, sorry.
Patrick