Skip to content

[Bug] Version of commit in develop merged to master changes if master is tagged #3105

Closed
@mycroes

Description

@mycroes

Describe the bug
In a repository where commit A from develop is merged into master as commit B, GitVersion generates a different version for commit A if B is tagged with a version.

Expected Behavior

GitVersion produces version (5.1.0-alpha.15+Branch.develop.Sha.ffaca48e8c7bf98e28bccbec0ee8816178f78470) based on history of commit A in develop, as it does when B is not tagged.

Actual Behavior

GitVersion produces version (6.1.0-alpha.0+Branch.develop.Sha.ffaca48e8c7bf98e28bccbec0ee8816178f78470) based on the 'future' merge of A into master as commit B with tag v6.0.0

Possible Fix

Ignore all commits derived from current commit in version calculation.

Steps to Reproduce

  1. Create commit A on develop
  2. Run GitVersion, take note of version generated
  3. Merge commit A into master, generating commit B
  4. Tag commit B with next release version
  5. Checkout develop (still pointing to commit A)
  6. Run GitVersion, take note of version generated

Context

Affects builds that deploy packages when the package deployment is ran after the merge commit has also been tagged. We deploy packages using Jenkins on merge in Gerrit, so there's a fair chance of this happening on the last commits before release.

Your Environment

  • Version Used: 5.10.1
  • Windows 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions