Skip to content

Conversation

@wjrogers
Copy link
Contributor

Query the mainline commit log starting from mainline tip regardless of the current branch. Stop considering mainline commits after the merge root for the current branch (or, if the current branch has been merged to mainline but has new commmits, the last commit that merged the current branch into mainline). This keeps the mainline version consistent on long-lived branches that may be merged into mainline many times, such as the develop branch in the GitFlow model.

When there is more than one potential mainline branch, before falling back to the first branch in the list, choose 1) the current branch, if it is a possible mainline; or 2) the first potential mainline from which
the current commit is reachable in a FirstParentOnly walk (i.e. is a direct commit on that branch).

Additionally, don't discard potential mainlines with equal tip because it might reduce the effectiveness of the new heuristics. Generally speaking, this makes the calculation of mainline version more stable along support branches by treating the support branch as mainline.

fixes #1035

wjrogers and others added 4 commits November 25, 2018 20:29
Query the mainline commit log starting from mainline tip regardless of
the current branch. Stop considering mainline commits after the merge
root for the current branch (or, if the current branch has been merged
to mainline but has new commmits, the last commit that merged the
current branch into mainline).

fixes #1035
When there is more than one potential mainline branch, before falling
back to the first branch in the list, choose 1) the current branch, if
it is a possible mainline; or 2) the first potential mainline from which
the current commit is reachable in a FirstParentOnly walk (i.e. is a
direct commit on that branch).

Additionally, don't discard potential mainlines with equal tip because
it might reduce the effectiveness of the new heuristics.

Fixes the test MainlineDevelopmentMode.VerifySupportForwardMerge vs the
previous commit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect mainline version being calculated

3 participants