Re: [PATCH v2 00/18] setup: drop uses of `the_repository`
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- May 19, 2026, 09:26 UTC
- Message-ID
- <CAOLa=ZSxhtorR+t-4M_COxfu6HwpcB0hr43OhqcwgkU+VLX6qQ@mail.gmail.com>
- In-Reply-To
- <20260518-pks-setup-wo-the-repository-v2-0-6933c0f1d568@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 27 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()` >
I think the series looks to be in a good state, I left some small nits, feel free to ignore.
- Karthik