Repository navigation
fix: pick the same parent on a full tie whatever the branch order - #24
Merged
Merged
Conversation
When two candidate parents were equally close and their merge-bases had the same committer timestamp, the first one in the branch list won, and that order isn't stable, so one sync could rebase onto a and the next onto b. Break the remaining tie by preferring the default branch, then the first name alphabetically, and list the tied candidates sorted.
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.
When a branch is equally close to two candidate parents, wt-sync breaks the tie by the newer merge-base commit. If those timestamps are equal too, which is common when commits land in the same second or the candidates share a merge-base, the first candidate in the branch list won. That list order isn't stable, so the pick could flip between runs: one
wt syncrebases onto a, the next onto b. This is what madebranch_with_merge_commits_is_not_flattenedflaky before #23.The last tie now goes to the default branch, then to the first name alphabetically, and the "equidistant parents" warning lists the candidates sorted. The new test runs inference over the same repo with three branch orders and checks they all pick the same parent.