Re: [PATCH v2 0/3] refs: report old OIDs for batched deletions
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Sep 21, 2026, 13:57 UTC
- Message-ID
- <CAOLa=ZR4V45R0zST_gxb3FMSWCwbi2MFN=5sCzhTAQfuZrRH7g@mail.gmail.com>
- In-Reply-To
- <cover.1789901584.git.maciej.ciemborowicz@gmail.com>
Maciej Ciemborowicz <maciej.ciemborowicz@gmail.com> writes:
Show 14 quoted lines
> The reference-transaction hook receives zero as both the old and new OID > when branch, tag, fetch, and remote delete refs through refs_delete_refs(). > Those callers already know the values that they selected for deletion. > > Teach refs_delete_refs() to accept aligned old OIDs and pass them into the > transaction. Besides making the hook records useful, this makes the selected > callers reject concurrent changes instead of deleting values that they did > not inspect. For branch and tag, this restores the compare-and-delete > behavior that existed before 8198907795 converted them to batched deletion. > For pruning, it prevents a stale scan from deleting a ref updated by another > process. > > The values are already available at every updated call site, so the series > adds no ref reads and retains batched performance.
I still have some concerns about backward comparability here, since we go from a delete all without any checks to a all-or-nothing situation, which can be an issue with commands like `git fetch --prune`.
Left some comments on the individual patches.
Show 11 quoted lines
> > Changes since v1: > > * Document the conditional deletion behavior and its race protection. > * Add tests that update refs from the hook's preparing phase and verify that > branch deletion and remote pruning preserve the concurrent update. > * Avoid printing deletion status when a non-atomic prune fails. > * Use a local string_list_item in refs_delete_refs(), as suggested by > Karthik. > > Based on maint at e9019fcafe (Git 2.55).
Might be worthwhile to rebase on top of master. Seems like there are conflicts with d38352cd43 (A few more fixes before -rc2, 2026-09-17).
[snip]
Thanks!