[PATCH 0/7] rerere: remove global state
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 23, 2026, 12:50 UTC
- Message-ID
- <20261023-pks-rerere-wo-the-repository-v1-0-b6ac0c2e4b81@pks.im>
Hi,
I got sucked down a rabbit hole once again while reviewing tb/rerere-wait-for-merge-rr-lock. I originally wanted to refactor the rerere subsystem to use subcommands, and I did. But while doing those refactorings I also started getting rid of global state, and that has expanded in scope more than I was originally expecting.
So I split out this refactoring into its separate patch series, which is this one here. On the one hand it gets rid of `the_repository`. On the other hand it also refactors "rerere.c" to not track state via global variables anymore so that it can be used multiple times for different repositories.
This series is based on 7e34d8174d (The 8th batch, 2026-10-22) with tb/rerere-wait-for-merge-rr-lock at 5f6b6aa3ab (rerere: add "gc --skip-locked" for auto maintenance, 2026-10-13) merged into it.
Thanks!
Patrick
---
Patrick Steinhardt (7):
rerere: stop using `the_repository` in `rerere_path()`
rerere: stop using `the_repository` in internal helpers
rerere: remove redundant calls to `repo_config()`
rerere: cache result of `is_rerere_enabled()`
rerere: stop using `the_repository`
rerere: bundle global state into a struct
rerere: get rid of global rerere cache statebuiltin/rerere.c | 21 ++-- hex.c | 4 +- hex.h | 3 + repository.c | 1 + repository.h | 6 ++ rerere.c | 309 ++++++++++++++++++++++++++++++------------------------- rerere.h | 23 ++++- 7 files changed, 216 insertions(+), 151 deletions(-)
--- base-commit: 13ef06d9d38088a2d97f612dca15fcd472f7b8ed change-id: 20261022-pks-rerere-wo-the-repository-f6620accf4ee