From: Patrick Steinhardt Date: Mon, 13 Apr 2026 05:48:08 GMT Subject: Re: [PATCH 00/18] setup: drop uses of `the_repository` Message-ID: In-Reply-To: On Thu, Apr 09, 2026 at 09:05:21AM -0400, Karthik Nayak wrote: > Patrick Steinhardt writes: > > > 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 Thanks! Patrick