Repository navigation
fix: don't rebase branches whose merge commits a rebase would flatten - #22
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.
diffnav had a local integration branch,
all-features:copy-lineplus merges ofhunk-nav,watch-posandclipboard-error, with hand-resolved conflicts.wt syncplanned to rebase it ontocopy-line. A plaingit rebasedrops merge commits and replays everything they brought in one commit at a time, so it would hit the same conflicts again and leave the worktree mid-rebase, which destroys a branch like that. The conflict check from #20 doesn't help here: the end result merges fine, and the trouble is in the replay.Before a rebase,
rev-list --merges --parents base..branchlists the merges it would replay. A merge counts if any merged-in side isn't already in the new parent; then the branch is skipped with everything above it, same as a predicted conflict:A merge whose other side is already in the parent, like merging
maininto a feature branch to catch up, doesn't count: the rebase drops those commits as already upstream and loses nothing, so those branches are rebased as before.The dry run plans each branch against its parent's current tip, so a branch above a parent that's about to be rebased showed as "up to date" even though the real run rebases it. For those, the plan now checks merges too, so the skip shows up in
-n.Tests in
tests/conflict.rs: an integration branch onathat merges siblingbis skipped and left as is whileaandbare rebased, and a feature branch that mergedmaininto itself still gets rebased.