git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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 state
 builtin/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

Next: Patrick Steinhardt
Message 1 of 10 in “rerere: remove global state”
  1. 0/7 rerere: remove global statePatrick Steinhardt, Oct 23, 2026
  2. 1/7 rerere: stop using `the_repository` in `rerere_path()`Patrick Steinhardt, Oct 23, 2026
  3. 2/7 rerere: stop using `the_repository` in internal helpersPatrick Steinhardt, Oct 23, 2026
  4. 3/7 rerere: remove redundant calls to `repo_config()`Patrick Steinhardt, Oct 23, 2026
  5. 4/7 rerere: cache result of `is_rerere_enabled()`Patrick Steinhardt, Oct 23, 2026
  6. 5/7 rerere: stop using `the_repository`Patrick Steinhardt, Oct 23, 2026
  7. 6/7 rerere: bundle global state into a structPatrick Steinhardt, Oct 23, 2026
  8. 7/7 rerere: get rid of global rerere cache statePatrick Steinhardt, Oct 23, 2026
  9. Junio C HamanoOct 23, 2026
  10. Patrick SteinhardtOct 26, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.