Re: [PATCH 00/18] setup: drop uses of `the_repository`
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Apr 9, 2026, 13:05 UTC
- Message-ID
- <CAOLa=ZRrK_5shCZwOar47kODe1kDKzcfXo764o9mE5ZA7xGePw@mail.gmail.com>
- In-Reply-To
- <20260330-pks-setup-wo-the-repository-v1-0-0d2e822837aa@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 33 quoted lines
> Hi, > > I've had enough of "setup.c" and its complexities, so I finally decided > to take the bullet and start refactoring this subsystem. This here is > the first out of the following three steps: > > 1. Drop all uses of `the_repository`. This doesn't yet allow us to get > rid of `USE_THE_REPOSITORY_VARIABLE`. > > 2. Convert a couple of global variables and drop > `is_bare_repository_cfg`, which then allows us to drop > `USE_THE_REPOSITORY_VARIABLE`. > > 3. Refactor the subsystem a bit so that we stop intermixing repository > discovery and repository initialization. This is my original > motivation as I want to get rid of `odb_prepare_alternates()`, but > due to the way we initialize the repository it has proven to be > extremely tedious. > > Most of the patches in this series here are rather mechanical. There's > only a handful of patches that warrant more attention: > > - 2/18: setup: stop using `the_repository` in `is_inside_worktree()` > - 3/18: setup: stop using `the_repository` in `is_inside_git_dir()` > - 9/18: setup: stop using `the_repository` in `setup_work_tree()` > - 10/18: setup: stop using `the_repository` in `set_git_work_tree()` > > Those patches don't only mechanical move stuff around, but also change > some logic to make it work. > > The series is based on 5361983c07 (The 22nd batch, 2026-03-27). There is > a single merge commit with "seen", but it's trivial to resolve. >
The series looks good to me as is, like mentioned most of the patches were fairly straight forward where we simply inject the repo variable into the function. Thanks
[snip]