Re: [PATCH v2 1/1] replay: make atomic ref updates the default behavior
- From
Karthik Nayak <karthik.188@gmail.com>
- Date
- Oct 2, 2025, 10:00 UTC
- Message-ID
- <CAOLa=ZQjMzCiVd8tRXtJJ8yXxLgwGQDgOZW3F86h9jC71NJm5w@mail.gmail.com>
- In-Reply-To
- <9052eccc-1121-442f-ad51-4fe9217024a0@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 18 quoted lines
> 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]