Repository navigation
Default to atomic git pushes - #596
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Submit’s changed ordering risks prematurely marking reordered PRs as merged and needs human validation of a recovery-safe approach.
2 open issues
What changed in this PR
Makes Git pushes atomic by default across gh-stack’s publishing commands, replacing opt-in atomicity with explicit opt-outs.
Changes:
- Add
--no-atomicandGH_STACK_NO_ATOMICcontrols topush,submit,sync, andlink. - Batch submit’s branch pushes before PR creation and updates.
- Expand push-safety tests and document atomicity, override precedence, and recovery behavior.
| File | Description |
|---|---|
| skills/gh-stack/references/commands.md | Document atomic defaults, opt-outs, and submit ordering. |
| README.md | Update command descriptions and flag tables. |
| internal/git/gitops_test.go | Compare atomic and non-atomic behavior on lease rejection. |
| docs/src/content/docs/reference/cli.md | Document flags, environment precedence, and atomicity limits. |
| docs/src/content/docs/guides/workflows.md | Explain atomic pushes in the rebase workflow. |
| cmd/sync.go | Add atomic opt-outs while preserving force-push selection. |
| cmd/sync_test.go | Assert atomic pushes with and without rebasing. |
| cmd/submit.go | Push active branches together before processing PRs. |
| cmd/submit_test.go | Update batching, ordering, and pending-modify recovery coverage. |
| cmd/push.go | Enable atomic pushes by default with explicit opt-outs. |
| cmd/push_test.go | Cover defaults, override precedence, and no automatic downgrade. |
| cmd/link.go | Make existing atomic push behavior configurable. |
| cmd/link_test.go | Assert non-force, atomic branch pushes. |
Review effort: Max
skarim
force-pushed
the
skarim/push-atomic-default
branch
from
October 26, 2026 20:37
70d9279 to
8c313e8
Compare
Lukeghenco
approved these changes
Oct 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Defaults Stack CLI pushes to atomic updates so branch updates succeed or fail together.
Functionality and user impact
push,submit,sync, andlinkpush branches together;submitnow uses one batch. PR/API updates are not atomic.--no-atomicorGH_STACK_NO_ATOMIC=1;--no-atomic=falseoverrides the environment. No automatic non-atomic retry.modifychanges, at-risk PRs temporarily target the trunk before pushing. Final bases are restored afterward; failures retain the existing recovery journal.Key areas to review
cmd/push.go,cmd/sync.go, andcmd/link.go. Existing force behavior stays unchanged.prepareReorderedPRsincmd/submit.goandcmd/submit_test.go. Protect reversed PR bases before the batch and preserve recovery on failure.cmd/push_test.goandinternal/git/gitops_test.go. Flag precedence, no downgrade, and all-or-nothing ref updates.