From: Karthik Nayak Date: Mon, 21 Sep 2026 13:57:49 GMT Subject: Re: [PATCH v2 0/3] refs: report old OIDs for batched deletions Message-ID: In-Reply-To: Maciej Ciemborowicz writes: > 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. > > 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!