Skip to content

Keep commits pushed to a branch after it was merged - #66

Merged
Phlogistique merged 1 commit into
mainfrom
fix-merged-head-race
Nov 6, 2026
Merged

Phlogistique merged 1 commit into
mainfrom
fix-merged-head-race

Conversation

@Phlogistique

Copy link
Copy Markdown
Collaborator

If someone pushed to a branch after GitHub squash-merged it but before autorestack ran, autorestack recorded the new commit as a parent of the child without its changes, then deleted the branch. Reproduced locally, not seen in production.

Now the child is re-parented from the commit GitHub merged, and the branch is deleted only if it has not moved. Otherwise the run fails and the branch stays.

If someone pushed to a branch after GitHub squash-merged it but before autorestack ran, autorestack recorded the new commit as a parent of the child without its changes, then deleted the branch. Reproduced locally, not seen in production.

Now the child is re-parented from the commit GitHub merged, and the branch is deleted only if it has not moved. Otherwise the run fails and the branch stays.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Phlogistique
Phlogistique marked this pull request as ready for review November 6, 2026 16:57
@Phlogistique
Phlogistique merged commit d225678 into main Nov 6, 2026
2 checks passed
@github-actions
github-actions Bot deleted the fix-merged-head-race branch November 6, 2026 16:58
Phlogistique added a commit that referenced this pull request Nov 8, 2026
Deleting the merged branch is the last step, after the children are
updated and retargeted, but a delete that fails aborts the run and turns
it red. Someone clicking "Delete branch" on the merged PR right after
merging is enough to race it, as happened on scortexio/sensei#8247.

If the branch still exists but moved, the run still fails and the branch
stays, as in #66.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant