Skip to content
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

GitVersion automatically increases the minor version regardless of the branch configuration #2678

Closed
syamrag opened this issue May 5, 2021 · 5 comments

Comments

@syamrag
Copy link

syamrag commented May 5, 2021

I am using gitversion 5.6.9 and I am on Ubuntu 16.04.1. I am following gitflow work flow and I have created a hotfix branch from master branch. I set the increment for hotfix branch to "Patch" and mode to "ContinuousDelivery". When ever I make any commits on hotfix branch the gitversion automatically increases the minor version regardless of the branch configuration I given.

Master - 1.0.0

hotfix - 1.0.0

Once I make any commit on hotfix the gitversion becomes 1.1.0 instead of 1.0.1.

@syamrag
Copy link
Author

syamrag commented May 5, 2021

mode: ContinuousDeployment
continuous-delivery-fallback-tag: ''
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'
legacy-semver-padding: 4
build-metadata-padding: 4
commit-message-incrementing: Enabled
tag-prefix: '[vV]'

branches:
  feature:
    tag: 'a'
    mode: ContinuousDelivery
    regex: features?[/-]
    increment: Inherit
    prevent-increment-of-merged-branch-version: false
    is-release-branch: false
    track-merge-target: false
    tracks-release-branches: false
    source-branches: ['develop', 'hotfix']

  develop:
    tag: 'b'
    mode: ContinuousDeployment
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    is-release-branch: false
    track-merge-target: true
    tracks-release-branches: true

  release:
    tag: 'rc'
    mode: ContinuousDelivery
    regex: releases?[/-]
    increment: Inherit
    prevent-increment-of-merged-branch-version: true
    is-release-branch: true
    track-merge-target: false
    tracks-release-branches: false

  master:
    tag: ''
    mode: ContinuousDelivery
    regex: ^master$|^main$
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    is-release-branch: false
    track-merge-target: false
    tracks-release-branches: false

  pull-request:
    tag: 'pr'
    mode: ContinuousDelivery
    regex: (pull|pull\-requests|pr)[/-]
    increment: Inherit
    prevent-increment-of-merged-branch-version: false
    tag-number-pattern: '[/-](?<number>\d+)[-/]'
    is-release-branch: false
    track-merge-target: false
    tracks-release-branches: false

  hotfix:
    tag: 'post'
    mode: ContinuousDelivery
    regex: hotfix(es)?[/-]
    increment: Patch
    prevent-increment-of-merged-branch-version: false
    is-release-branch: false
    track-merge-target: false
    tracks-release-branches: false

@asbjornu
Copy link
Member

asbjornu commented May 5, 2021

This seems to completely contradict #2454?

@syamrag
Copy link
Author

syamrag commented May 5, 2021

Yes, I think so. I also tried to set the increment to "Major" and "None" and regardless of the configuration gitversion still increment the minor portion.

@asbjornu
Copy link
Member

asbjornu commented May 6, 2021

Can you please just try to delete GitVersion.yml and tell me how it behaves then?

@asbjornu asbjornu changed the title I am using gitversion 5.6.9 and I am on Ubuntu 16.04.1. I am following gitflow work flow and I have created a hotfix branch from master branch. I set the increment for hotfix branch to "Patch" and mode to "ContinuousDelivery". When ever I make any commits on hotfix branch the gitversion automatically increases the minor version regardless of the branch configuration I given. GitVersion automatically increases the minor version regardless of the branch configuration May 6, 2021
@syamrag
Copy link
Author

syamrag commented May 6, 2021

Quick update on this. I was able to solve the problem. When I changed the hot fix branch form "hotfix" to "hotfix/fix" it works as expected. So, I think the problem is with regular expression pattern I used to match the hotfix branch. You can close this issue and Thanks for your help.

@syamrag syamrag closed this as completed May 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants