Repository navigation
feat: skip branches that would conflict instead of stopping mid-rebase - #20
Merged
Merged
Conversation
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.
wt-sync -upPfrom diffnav's main tried to rebasecontext-expand, an old one-commit WIP branch 91 commits behind main, hit conflicts in three files, and stopped there with that worktree mid-rebase. The stack that actually mattered (osc1717) never got pushed, and the same happened earlier withicon-alingment.Before each rebase,
git merge-tree --write-tree --merge-base <base> <parent> <branch>now works out the result without touching any worktree. If it would conflict, the branch and everything stacked on it are skipped with a warning naming the files, they aren't pushed, their fork-points stay as they were, and the sync carries on with the other stacks. The run still exits non-zero at the end (after pushing and pruning the rest), sowt sync && ...stops as before. The dry run shows the same thing:The check looks at the end result while a rebase replays commit by commit, so now and then they can disagree. A conflict it didn't predict stops the sync exactly as it does today. If
merge-treecan't run (git older than 2.40), there's no check and nothing changes.Also from the same run: from the default branch's worktree "the current stack" means every stack, which is a lot to do implicitly when
-Premoves worktrees. It now says so first:On main, so syncing all 4 stacks: clipboard-error, context-expand, icon-alingment-squash, osc1717. Run from a stack's worktree to sync only that one.It doesn't print with--allor when there is only one stack.New
tests/conflict.rs: a conflicting branch and the one on top of it are skipped with their worktree untouched, a clean sibling is still rebased, the exit is non-zero, and the every-stack line shows up from main but not with--all. README's key behaviours updated.