Skip to content

[Bugfix] CommitsSinceVersionSource decreases upon deleting a merged Release branch #1635

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

Conversation

ruhullahshah
Copy link
Contributor

@ruhullahshah ruhullahshah commented Mar 11, 2019

Problem:

Upon deleting a merged release branch, CommitsSinceVersionSource decreases as reported in issue #1526.

Root Cause:

After the release branch is deleted, we have no way to calculate the BaseVersionSource correctly from the existing BaseVersion calculation strategies.

Assumptions:

  • The release branch was merged using the --no-ff policy.
  • The corresponding merge commit has 2 parents only.
  • The merge commit message contains the Merge branch and release keywords.

Fix:

The intuition behind the fix is that if a release branch was merged with the stated assumptions and deleted, then the BaseVersionSource calculated by MergeMessageBaseVersionStrategy is updated to point to the merge-base of the parents of the merge commit. The existing code then calculates the CommitsSinceVersionSource correctly.

@LordMike
Copy link

Just chiming in that I'm seeing this issue, and am surprised to see an hour old PR that will remediate it :).

👍

@ruhullahshah ruhullahshah force-pushed the bugfix/CommitsSinceVersionSource-goes-down-on-deleting-a-merged-feature branch from dcd9215 to a100491 Compare March 13, 2019 15:57
@asbjornu asbjornu merged commit deaaa0f into GitTools:master Mar 14, 2019
@asbjornu
Copy link
Member

Amazing, thanks @ruhullahshah!

@ruhullahshah
Copy link
Contributor Author

@asbjornu You are welcome

@ruhullahshah ruhullahshah deleted the bugfix/CommitsSinceVersionSource-goes-down-on-deleting-a-merged-feature branch March 15, 2019 16:49
@asbjornu asbjornu added this to the 5.0.0 milestone Mar 18, 2019
@arturcic arturcic added the bug label Mar 22, 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.

4 participants