Repository navigation
feat(resolve): open a session on the conflict that stopped a rebase - #41
Merged
Merged
Conversation
dw-mc resolve <pr> puts the recorded conflict on the table: a worktree of my own on dw-mc/rebase/<number>, the rebase redone there and left stopped where it stops, the unmerged files on screen, and an interactive session carrying them and what the pull request is for. The tool resolves nothing; finishing the rebase, committing and pushing are mine, which is why the worktree outlives the session. dw-mc rebase is untouched: it still aborts and still leaves no partial state. The invariant is about the throwaway worktree a rebase cuts, and this worktree is one I asked for. rebase.enabled does not gate this, because nothing here writes to GitHub. What it does refuse is a pull request I did not author, one from a fork, one in a stack, and one with no conflict at the head it is now at, which goes to dw-mc rebase instead. The branch guards are the ones a rebase already reads, now in one place both commands ask. rerere is turned on in the tool's clone, so a conflict I resolve once is one git replays by itself on the next rebase. Closes #38 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Verified against git 2.55: a replay of a conflict resolved once stages the old resolution and still exits non-zero, with nothing left unmerged. Turning rerere on without handling that would have made dw-mc rebase abort over its own recorded resolution and push nothing, and dw-mc resolve report git's error instead of a finished replay. One replay now serves both worktrees, with an abort policy for the only thing that differs between them. A stop is a conflict where files are unmerged, a replay to continue where rerere staged one, and git's own failure where it is neither. The branch guards both commands share say nothing about pushing any more, because resolve pushes nothing. The session a launcher opens is named for what it is, now that a conflict opens one too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The step after a resolve session is mine, and it was a sentence to read rather than something to run. It is now the lines themselves - the worktree to be in, the rebase to continue, the push - so finishing is a paste. A replay that went through prints the two it needs instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
dw-mc resolve <pr>puts a recorded conflict on the table: a worktree of my own ondw-mc/rebase/<number>that tracks the pull request's branch and stands after the session, the rebase redone there and left stopped where it stops, the unmerged files on screen, and an interactive session carrying them and what the pull request is for. The tool resolves nothing; finishing the rebase, committing and pushing are mine, which is why the worktree outlives the session.dw-mc rebasestill aborts and still leaves no partial state. That invariant is about the throwaway worktree a rebase cuts; this worktree is one I asked for, so a rebase in progress in it is the point.rebase.enableddoes not gate this, because nothing here writes to GitHub (ADR 0002). What it refuses is a pull request I did not author, one from a fork, one in a stack, and one with no conflict at the head it is now at, which goes todw-mc rebaseinstead. The branch guards are the ones a rebase already read, now in one place both commands ask and worded for both.flowchart LR A[dw-mc resolve] --> B{guards} B -->|refused| C[one sentence, nothing cut] B -->|passed| D[worktree on dw-mc/rebase/N] D --> E[git rebase base] E -->|conflict| F[paths on screen, session opens] E -->|replayed by rerere| G[nothing to resolve] F --> H[I continue the rebase and push]rerere, and what it cost
rerereis on in the tool's clone, so a conflict resolved once is onegitanswers by itself. Verified against git 2.55: that replay stages the old resolution and still exits non-zero, with nothing left unmerged —gitnever continues a rebase on its own. Turning the key on and stopping there would have madedw-mc rebaseabort over its own recorded resolution and push nothing.So one replay now serves both worktrees and reads a stop three ways: unmerged files are a conflict, a staged stop with a rebase in flight is continued, and anything else is
git's own failure. The only difference between the two callers is whether a conflict aborts.Closes #38
🤖 Generated with Claude Code