[PATCH v2 0/1] replay: make atomic ref updates the default behavior
- From
Siddharth Asthana <siddharthasthana31@gmail.com>
- Date
- Sep 26, 2025, 23:08 UTC
- Message-ID
- <20250926230838.35870-1-siddharthasthana31@gmail.com>
- In-Reply-To
- <20250908043620.57848-1-siddharthasthana31@gmail.com>
This is v2 of the git-replay atomic updates series.
Based on the extensive community feedback from v1, I've completely redesigned the approach. Instead of adding new --update-refs options, this version makes atomic ref updates the default behavior of git replay.
Why this change makes sense: - git replay is explicitly marked as EXPERIMENTAL with behavior changes expected - The command is primarily used server-side where atomic transactions are crucial - Current pipeline approach (git replay | git update-ref --stdin) creates coordination complexity and lacks atomic guarantees by default - Patrick Steinhardt noted performance issues with individual ref updates in reftable backend - Elijah Newren and Junio Hamano endorsed making the better behavior default
The new design:
# Default: atomic ref updates (no pipeline needed)
git replay --onto main topic1..topic2 # Traditional behavior preserved for compatibility
git replay --output-commands --onto main topic1..topic2 | git update-ref --stdinKey changes since v1: - Made atomic ref updates the default instead of opt-in via --update-refs - Eliminated confusing --update vs --update-refs option distinction - Avoided naming collision with git rebase --update-refs - Fixed --allow-partial exit code behavior (exits 0 only if ALL updates succeed) - Used die_for_incompatible_opt2() for consistent error reporting - Updated documentation with proper line wrapping and consistent terminology - Added comprehensive testing and performance considerations
This approach gives us atomic transactions by default while preserving full backward compatibility for existing workflows that need the pipeline approach.
Thanks to Christian Couder, Patrick Steinhardt, Elijah Newren, Junio C Hamano, Kristoffer Haugsbakk, and Andrei Rybak for the excellent feedback that led to this much cleaner design!
Siddharth Asthana (1): replay: make atomic ref updates the default behavior
Documentation/git-replay.adoc | 76 +++++++++++++--- builtin/replay.c | 114 ++++++++++++++++++++--- t/t3650-replay-basics.sh | 166 ++++++++++++++++++++++++++++++++-- 3 files changed, 319 insertions(+), 37 deletions(-)
-- 2.51.0