question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

feat: Incrementing patch instead minor

See original GitHub issue

When writing commit messages to feat changes, only minor version is incremented. Ex: On version 1.0.0 Create a commit with message: “feat: Some feature.”

Expected Behavior

The version should be 1.1.0

Actual Behavior

The version is 1.0.1

Steps to Reproduce

1 - Clone the repo: https://github.com/allanalves23/gitversion-minor-bug-fixture 2 - Download command line tool: https://gitversion.net/docs/usage/cli/installation 3 - On master branch create any change and create one commit: “feat: should be 1.1.0” 4 - Check version with command dotnet-gitversion

Output of dotnet-gitversion before feat commit:

{
  "Major": 1,
  "Minor": 0,
  "Patch": 0,
  "PreReleaseTag": "1",
  "PreReleaseTagWithDash": "",
  "PreReleaseLabel": "",
  "PreReleaseLabelWithDash": "",
  "PreReleaseNumber": null,
  "WeightedPreReleaseNumber": 60000,
  "BuildMetaData": null,
  "BuildMetaDataPadded": "",
  "FullBuildMetaData": "Branch.master.Sha.7472e6fd0cb3565e91b5cc22a7f57c4d589dcf82",
  "MajorMinorPatch": "1.0.0",
  "SemVer": "1.0.0",
  "LegacySemVer": "1.0.0",
  "LegacySemVerPadded": "1.0.0",
  "AssemblySemVer": "1.0.0.0",
  "AssemblySemFileVer": "1.0.0.0",
  "FullSemVer": "1.0.0",
  "InformationalVersion": "1.0.0+Branch.master.Sha.7472e6fd0cb3565e91b5cc22a7f57c4d589dcf82",
  "BranchName": "master",
  "EscapedBranchName": "master",
  "Sha": "7472e6fd0cb3565e91b5cc22a7f57c4d589dcf82",
  "ShortSha": "7472e6f",
  "NuGetVersionV2": "1.0.0",
  "NuGetVersion": "1.0.0",
  "NuGetPreReleaseTagV2": "",
  "NuGetPreReleaseTag": "",
  "VersionSourceSha": "e79e24b2cc466ddd1d5138c8488aca389c171a79",
  "CommitsSinceVersionSource": 1,
  "CommitsSinceVersionSourcePadded": "0001",
  "UncommittedChanges": 0,
  "CommitDate": "2021-05-16"
}

Output of dotnet-gitversion after feat commit:

{
  "Major": 1,
  "Minor": 0,
  "Patch": 1,
  "PreReleaseTag": "2",
  "PreReleaseTagWithDash": "",
  "PreReleaseLabel": "",
  "PreReleaseLabelWithDash": "",
  "PreReleaseNumber": null,
  "WeightedPreReleaseNumber": 60000,https://github.com/allanalves23/gitversion-minor-bug-fixture
  "BuildMetaData": null,
  "BuildMetaDataPadded": "",
  "FullBuildMetaData": "Branch.master.Sha.9b03dd2ceaa5a73a784c0bcd100e722643adaa8a",
  "MajorMinorPatch": "1.0.1",
  "SemVer": "1.0.1",
  "LegacySemVer": "1.0.1",
  "LegacySemVerPadded": "1.0.1",
  "AssemblySemVer": "1.0.1.0",
  "AssemblySemFileVer": "1.0.1.0",
  "FullSemVer": "1.0.1",
  "InformationalVersion": "1.0.1+Branch.master.Sha.9b03dd2ceaa5a73a784c0bcd100e722643adaa8a",
  "BranchName": "master",
  "EscapedBranchName": "master",
  "Sha": "9b03dd2ceaa5a73a784c0bcd100e722643adaa8a",
  "ShortSha": "9b03dd2",
  "NuGetVersionV2": "1.0.1",
  "NuGetVersion": "1.0.1",
  "NuGetPreReleaseTagV2": "",
  "NuGetPreReleaseTag": "",
  "VersionSourceSha": "e79e24b2cc466ddd1d5138c8488aca389c171a79",
  "CommitsSinceVersionSource": 2,
  "CommitsSinceVersionSourcePadded": "0002",
  "UncommittedChanges": 0,
  "CommitDate": "2021-05-16"
}

Screenshot after feat commit:

Screenshot from 2021-05-16 20-13-36

GitVersion.yml are on project below.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
allanalves23commented, Mar 8, 2022

@asbjornu this works perfectly.

image

My GitVersion.yml

mode: MainLine # Only add this if you want every version to be created automatically on your main branch.

major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]\\))?(!:|:.\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"

branches:
  master:
    regex: ^latest$|^master$|^main$|^release$
  pull-request:
    tag: pr

Thx @asbjornu and @gep13 !!

3reactions
asbjornucommented, Mar 8, 2022

@asbjornu in this case, isn’t \f in the regex looking for a form feed?

Should the minor-version-bump-message not simply be: fix:\s??

@gep13, good catch! Yeah, the initial backslash looks like an error. Why did you put it there, @allanalves23? Please use the conventional commit regexes we have documented:

mode: MainLine # Only add this if you want every version to be created automatically on your main branch.
major-version-bump-message: "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?(!:|:.*\\n\\n((.+\\n)+\\n)?BREAKING CHANGE:\\s.+)"
minor-version-bump-message: "^(feat)(\\([\\w\\s-]*\\))?:"
patch-version-bump-message: "^(build|chore|ci|docs|fix|perf|refactor|revert|style|test)(\\([\\w\\s-]*\\))?:"
Read more comments on GitHub >

github_iconTop Results From Across the Web

Version Incrementing
When you release the next version of your library/app/website/whatever you should only increment major/minor or patch then reset all lower parts to 0, ......
Read more >
Major.Minor.Patch. An illustrated guide to semantic…
Loose dependencies of software, matching to highest patch ( ~ ) or even highest minor ( ^ ), is very common, and spawning...
Read more >
Semantic-Release - pre-release version not incrementing ...
First push for "next" creates a tag called v1.0.0-next.1. However, another feat commit doesnt increment the version to v1.1.0-next.1. It just ...
Read more >
7. Releasing and versioning
We call an increment a “bump”, and it consists of adding 1 to either the major, minor, or patch identifier as follows: Patch...
Read more >
Semantic Versioning 2.0.0 | Semantic Versioning
PATCH, increment the: MAJOR version when you make incompatible API changes; MINOR version when you add functionality in a backward compatible manner; PATCH...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found