Skip to content

Always compute mainline version with mainline commits #1540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 15, 2019
Merged

Always compute mainline version with mainline commits #1540

merged 4 commits into from
Feb 15, 2019

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.
@asbjornu asbjornu merged commit ef1add0 into GitTools:master Feb 15, 2019
@asbjornu asbjornu added this to the 5.0.0 milestone Feb 19, 2019
@arturcic arturcic added the Bug label Mar 7, 2019
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