[PATCH 0/9] refs: stop using `chdir_notify_reparent()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Jun 10, 2026, 14:57 UTC
- Message-ID
- <20260610-b4-pks-refs-avoid-chdir-notify-reparent-v1-0-56c864b01c43@pks.im>
Hi,
this patch series is a follow-up of the discussion at [1]. It converts the reference backends to always use absolute paths internally, which then allows us to drop the calls to `chdir_notify_reparent()`.
Unfortunately, the series has grown quite a bit larger than anticipated. This is due to a couple of weirdnesses in how the reference database is constructed with an "onbranch" condition. We essentially construct the refdb twice and loose one, but we never noticed because the chdir notification subsystem kept the pointer to it reachable.
Note that the first couple patches that touch "setup.c" aren't strictly required. They are a remnant of a previous iteration where I tried to solve the issue in a different way. But I ultimately figured that these changes are worth it by themselves as they simplify "setup.c" a bit.
This series is built on top of 1ff279f340 (The 13th batch, 2026-06-09) with ps/setup-centralize-odb-creation at 42b9d3dc9d (setup: construct object database in `apply_repository_format()`, 2026-06-04) merged into it.
Thanks!
Patrick
[1]: <aifAVpxanV31KUpC@pks.im>
---
Patrick Steinhardt (9):
setup: inline `check_and_apply_repository_format()`
setup: stop applying repository format twice
setup: don't apply "GIT_REFERENCE_BACKEND" without a repository
refs: unregister reference stores from "chdir_notify"
chdir-notify: drop unused `chdir_notify_reparent()`
repository: free main reference database
refs: fix recursing `get_main_ref_store()` with "onbranch" config
refs: drop local buffer in `refs_compute_filesystem_location()`
refs: always use absolute paths for reference storeschdir-notify.c | 26 ------------ chdir-notify.h | 6 +-- refs.c | 35 ++++++++++++----- refs/files-backend.c | 6 --- refs/packed-backend.c | 4 +- refs/reftable-backend.c | 3 -- repository.c | 5 +++ setup.c | 96 ++++++++++++++++++--------------------------- t/pack-refs-tests.sh | 6 +-- t/t0600-reffiles-backend.sh | 4 +- t/t1423-ref-backend.sh | 9 +++-- t/t5510-fetch.sh | 2 +- 12 files changed, 83 insertions(+), 119 deletions(-)
--- base-commit: 255322df35357168daefec8523a3cdc849edd6c1 change-id: 20260609-b4-pks-refs-avoid-chdir-notify-reparent-a4eaf1edbcab