You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gh stack push advertises atomic updates but invokes git.Push with atomic disabled #216
gh stack push is documented as pushing every active branch with --force-with-lease --atomic, but the command currently invokes the Git push layer with atomicity disabled.
This is present in both v0.0.8 and the current main branch.
Current behavior
runPush calls:
git.Push(remote, activeBranches, true, false)
The fourth argument is atomic, so this requests lease-protected pushing without --atomic:
Meanwhile, the command help and documentation say the operation uses --force-with-lease --atomic to provide all-or-nothing updates.
Impact
The explicit per-branch leases are strong and prevent overwriting unexpected remote changes. However, without --atomic, a multi-branch push may update some stack branches before another branch is rejected. That can leave the remote stack partially updated despite the documented all-or-nothing guarantee.
This distinction matters for automation that treats a rejected stack push as proof that no remote branch changed.
Expected behavior
gh stack push should pass atomic=true when pushing the active branches, consistent with its help text and documentation.
It would also be useful to add a test that rejects one ref in a multi-ref push and verifies that none of the remote refs update.
It passes go vet ./..., go test -race -count=1 ./..., and the docs build. The change enables the existing atomic push path, updates the behavior docs, and adds a real-git regression test where one stale lease prevents both refs from updating.
I couldn't open the upstream PR because this repository currently has pull_request_creation_policy: collaborators_only; GitHub rejected CreatePullRequest for my account. A collaborator can open the compare link above, or I can submit the PR if external PR creation is enabled.
Activity
tmchow commentedon Aug 5, 2026
I implemented and tested a focused fix on
tmchow:fix/atomic-stack-push: main...tmchow:gh-stack:fix/atomic-stack-pushIt passes
go vet ./...,go test -race -count=1 ./..., and the docs build. The change enables the existing atomic push path, updates the behavior docs, and adds a real-git regression test where one stale lease prevents both refs from updating.I couldn't open the upstream PR because this repository currently has
pull_request_creation_policy: collaborators_only; GitHub rejectedCreatePullRequestfor my account. A collaborator can open the compare link above, or I can submit the PR if external PR creation is enabled.fix(ce-babysit-pr): recover from non-atomic stack push instead of blo…