From: Karthik Nayak Date: Thu, 02 Oct 2025 10:00:30 GMT Subject: Re: [PATCH v2 1/1] replay: make atomic ref updates the default behavior Message-ID: In-Reply-To: <9052eccc-1121-442f-ad51-4fe9217024a0@gmail.com> Phillip Wood writes: > Hi Siddharth > > On 27/09/2025 00:08, Siddharth Asthana wrote: >> The git replay command currently outputs update commands that must be >> piped to git update-ref --stdin to actually update references: >> >> git replay --onto main topic1..topic2 | git update-ref --stdin >> >> This design has significant limitations for server-side operations. The >> two-command pipeline creates coordination complexity, provides no atomic >> transaction guarantees by default > > Are you sure that's true? Maybe I'm missing something but my reading of > builtin/update-ref.c is that it when "--stdin" is given it starts a ref > transaction, reads the commands from stdin and applies them to that > transaction and then commits the transaction which will make the updates > atomic. > You're right. Using '--stdin' is atomic by default. You can manually handle the transaction's by passing in the 'start', 'prepare', 'commit', 'abort' sub-commands in the '--stdin' mode. [snip]