Skip to content

[Bug] 'Increment: Minor' config does not work. Patch is only ever incremented #2870

@danijam

Description

@danijam

Describe the bug
I'm struggling to control the behaviour of GitVersion with respect to incrementing different parts of the version number. It appears to me that the configuration option named increment does not do anything. I'm wondering if I am using GitVersion entirely wrongly, would appreciate some feedback on the below.

Expected Behavior

I expect every commit to main will increment minor.

Actual Behavior

Every commit to main increments patch

Steps to Reproduce

GitVersion.yml

next-version: 0.0
assembly-versioning-scheme: Major
assembly-file-versioning-scheme: MajorMinorPatchTag
mode: ContinuousDeployment
continuous-delivery-fallback-tag: ''
increment: Minor
  1. Tag the head of main with a version such as 0.1.0
  2. Commit a new commit to main
  3. Run GitVersion

Context

Flow is in essence each contributor opens a branch off main, creates commits. opens PR. PR is squashed merged into main. the new build of that new commit in main should be built incrementing minor unless the major bump message is included.

Lets say I have this under git log --oneline

46ee618 (HEAD -> main) Commit 2
f6b2a66 (tag: 0.1.0) Commit 1

GitVersion wants the version of Commit 2 to be 0.1.1. I don't understand why when my config is set to increment minor.

Each commit on main should increment minor as this is a continuos deployment repo for a NuGet library. patch increments are controlled through hotfix branches and major increments are controlled through commit messages. So the default increment is minor. I've been banging my head against the wall struggling to find how to use GitVersion?

Your Environment

This can be reproduced on any environment. My test environment is just a sample empty git repo for testing GitVersion out for now.

  • Version Used: 5.7.0
  • Operating System and version (Windows 10, Ubuntu 18.04): Win 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions