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
Add pre-flight conflict detection for cross-stack commit and branch moves
When moving a commit or branch to a different stack, speculatively
simulate the impact on both sides before applying any changes:
Source check: rebase the remaining source commits without the moved
commit(s). If any would conflict, the move is rejected — those commits
depend on the changes being moved away.
Destination check: rebase the moved commit(s) onto the destination
insertion point. If any would conflict, the move is rejected — the
moved changes do not apply cleanly in the target context.
Pre-existing conflicts in the source stack are exempted: if a commit
was already conflicted before the move, it is not counted as a new
conflict caused by the move.
Moves that are now prevented:
- Moving a commit whose removal would leave dependent commits in the
source stack that can no longer rebase cleanly.
- Moving a commit onto a destination stack that already modified the
same content, causing a conflict at the insertion point.
- Moving a branch whose removal would strand dependent branches in
the source stack.
- Moving a branch onto a destination that has already modified the
same content.
Moves that are not affected:
- Intra-stack moves (source == destination); these cannot produce
inter-stack conflicts and skip the check entirely.
- Cross-stack moves where source and destination are truly independent
(disjoint file changes).
- Moves where the source stack has pre-existing conflicts unrelated to
the commit being moved.
The check is a pure read: no refs, no snapshot, no worktree state is
modified on rejection. It is invoked before create_snapshot so a
failure leaves the repository completely unchanged.
0 commit comments