Draft
Conversation
Copilot created this pull request from a session on behalf of
geofflamrock
April 21, 2026 11:44
View session
Agent-Logs-Url: https://github.com/geofflamrock/stack/sessions/e1f9279d-3940-4541-90c3-8d55a41ec675 Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
…layOntoNewParent Agent-Logs-Url: https://github.com/geofflamrock/stack/sessions/e1f9279d-3940-4541-90c3-8d55a41ec675 Co-authored-by: geofflamrock <2915931+geofflamrock@users.noreply.github.com>
087a137 to
3036989
Compare
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.
Summary
Adds support for the experimental
git replaycommand as a newreplayupdate strategy when updating a stack.Changes
New
--replayflag--replayoption toCommonOptions, wired intoUpdateStackCommandandSyncStackCommandReplayalongsideMergeandRebase--rebase,--merge,--replay) now raises a clear errorgit replaysupport in GitClientIGitClient/GitClientgainReplayFromSourceBranch(branchName, sourceBranchName, upstreamSha)andReplayOntoNewParent(branchName, newParentBranchName, oldParentCommitSha)methodsgit replay --onto <newbase> <upstream>..<branch>and then callsgit update-refwith the output — no working directory changes requiredProcessException(orConflictExceptionon conflict)Replay strategy in StackActions
UpdateStackUsingReplayfollows the same branch-line traversal and squash-merge re-parenting logic as the rebase strategygit replaydoesn't touch the working directory, no branch switching is neededbranchStatusessnapshot, ensuring correct ranges even after parent branches have been updatedConflictExceptionis caught and re-thrown with a user-friendly message explaining that interactive resolution is not possible; users should resolve manually and retry with a different strategyTests
UpdateStack_UsingReplay_WhenNoConflicts_CallsReplayForEachBranch— verifiesReplayFromSourceBranchis called for each branch with correct upstream SHAs and that noChangeBranchcalls are madeUpdateStack_UsingReplay_WhenConflictDetected_ThrowsConflictException— verifies conflicts surface as exceptionsUpdateStack_UsingReplay_WhenBranchHasMergedPullRequest_SkipsBranch— verifies inactive branches are skippedUpdateStack_UsingReplay_WhenBranchHasNoRemoteTrackingBranch_IsUpdated— verifies local-only branches are still replayedWhenReplayIsSpecified_StackIsUpdatedUsingReplay— command handler testWhenReplayAndRebaseAreSpecified_Throws— command handler test for mutual exclusion