Skip to content

Incorrect increment when merging feature branch into master. #1689

Closed
@mchippingtonderrick-afl

Description

When merging a feature branch into Master, GitVersion is incrementing the patch number, rather than the minor version number. The minor version number is correctly incremented when evaluated in-branch, but when merged into Master, it only increments the patch version, as if it was just a commit to master, rather than a merge.

Customised GitVersion.yml for reference:

mode: ContinuousDelivery
branches:
  master:
    regex: master
    tag: ''
    increment: Patch
  patch:
    regex: '(patch|bugfix|fix)[/-]'
    tag: useBranchName
    increment: Patch
    source-branches: ['master', 'major', 'minor']
  minor:
    regex: '(minor|feature)[/-]'
    tag: useBranchName
    increment: Minor
    source-branches: ['master', 'major']
  major:
    regex: '(major|breaking)[/-]'
    tag: useBranchName
    increment: Major
    source-branches: ['master']

Other potentially relevant information:
Merge is via merging a pull-request on GitHub.
GitVersion is being used in AzurePipelines triggered on commits, using the GitVersion add-in for it.
Example git history graph for clarity:

* - Master - v1.4.6 (calculated, should be v1.5.0)
|\
| * - Feature - v1.5.0-prerelease+2 (calculated)
| * - Feature - v1.5.0-prerelease+1 (calculated)
|/
* - Master - v1.4.5 - (tagged)

Any suggestions for what I must be doing wrong here, and how I can make it behave the way I would like it to?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions