Re: [PATCH v2 1/1] replay: make atomic ref updates the default behavior
- From
Siddharth Asthana <siddharthasthana31@gmail.com>
- Date
- Oct 2, 2025, 22:20 UTC
- Message-ID
- <64b63d62-482d-42b2-8090-60aac8f505d4@gmail.com>
- In-Reply-To
- <CAOLa=ZQjMzCiVd8tRXtJJ8yXxLgwGQDgOZW3F86h9jC71NJm5w@mail.gmail.com>
On 02/10/25 15:30, Karthik Nayak wrote:
Show 22 quoted lines
> Phillip Wood <phillip.wood123@gmail.com> 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.
Thanks for confirming this Karthik. I will correct the commit message to accurately represent what update-ref --stdin provides.
> > [snip]