Re: [PATCH v5 1/3] refs: allow callers to supply old OIDs for batch deletion
From: Patrick Steinhardt <hidden>
Date: 2026-09-28 06:44:02
On Thu, Sep 24, 2026 at 09:45:27AM -0700, Junio C Hamano wrote:
Patrick Steinhardt [off-list ref] writes:quoted
On Wed, Sep 23, 2026 at 11:04:40PM +0200, Maciej Ciemborowicz wrote:quoted
refs_delete_refs() performs unconditional deletions, so callers cannot preserve old values that they have already resolved. Consequently, reference-transaction hooks see a null old OID.I wasn't paying attention when I gave my reviews, but the above puzzles me. "callers cannot preserve", meaning "after deletion the values cannot be read anymore"? Of course, but then callers can read them beforehand and use the stored value when calling hooks later. Patrick, do you understand these three lines above? I don't, and I am asking you because below what you say mostly seems to make sense.
Yeah, I think it's less of a "cannot" but more of a "we do not". I mentioned this in a later patch, but I think the proper fix for what the author is after to have reference transactions always resolve the status quo and provide old object IDs regardless of whether the user provided one or not. If so we wouldn't have to change any of the interfaces at all, and we make sure that the reftx hook always gets invoked with proper old and new OIDs. Patrick