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.

[Bug]: GitVersion jumping versions for a single untagged commit

See original GitHub issue

Describe the bug For a single commit after a tagged commit, GitVersion Commandline suggests a version gap of 42 which coincidentally = CommitSinceVersionSource

image

The un-tagged commit should be 0.1.0-alpha.42 but GitVersion suggest 0.1.0-alpha0083 (i.e. previous version - 41 + CommitsSinceVersionSource - 42 = 83).

GitVersion.CommandLine

{
    "Major":0,
    "Minor":1,
    "Patch":0,
    "PreReleaseTag":"alpha.83",
    "PreReleaseTagWithDash":"-alpha.83",
    "PreReleaseLabel":"alpha",
    "PreReleaseNumber":83,
    "BuildMetaData":"",
    "BuildMetaDataPadded":"",
    "FullBuildMetaData":"Branch.develop.Sha.04c3569fa42b55388d8c133dbf0d3365dfda77be",
    "MajorMinorPatch":"0.1.0",
    "SemVer":"0.1.0-alpha.83",
    "LegacySemVer":"0.1.0-alpha83",
    "LegacySemVerPadded":"0.1.0-alpha0083",
    "AssemblySemVer":"0.1.0.0",
    "AssemblySemFileVer":"0.1.0.0",
    "FullSemVer":"0.1.0-alpha.83",
    "InformationalVersion":"0.1.0-alpha.83+Branch.develop.Sha.04c3569fa42b55388d8c133dbf0d3365dfda77be",
    "BranchName":"develop",
    "Sha":"04c3569fa42b55388d8c133dbf0d3365dfda77be",
    "ShortSha":"04c3569",
    "NuGetVersionV2":"0.1.0-alpha0083",
    "NuGetVersion":"0.1.0-alpha0083",
    "NuGetPreReleaseTagV2":"alpha0083",
    "NuGetPreReleaseTag":"alpha0083",
    "CommitsSinceVersionSource":42,
    "CommitsSinceVersionSourcePadded":"0042",
    "CommitDate":"2021-07-05"
}

GitVersion.yaml

assembly-informational-format: '{DefaultInformationalVersion}'
major-version-bump-message: '\+semver:\s?(breaking|major)'
minor-version-bump-message: '\+semver:\s?(feature|minor)'
patch-version-bump-message: '\+semver:\s?(fix|patch)'

branches:
  master:
    mode: ContinuousDelivery
    tag:
    increment: Patch
    prevent-increment-of-merged-branch-version: true
    track-merge-target: false
    regex: main
  develop:
    mode: ContinuousDeployment
    tag: alpha
    increment: Minor
    prevent-increment-of-merged-branch-version: false
    track-merge-target: true
    regex: dev(elop)?(ment)?$
  feature:
    mode: ContinuousDeployment
    tag: useBranchName
    increment: Inherit
    prevent-increment-of-merged-branch-version: false

ignore:
  sha: []

Expected Behavior

The un-tagged commit should be 0.1.0-alpha.42

Actual Behavior

The un-tagged commit is 0.1.0-alpha.83

Version Used:

  • Operating System and version (Windows 10, Ubuntu 18.04): Windows 7 Enterprise SP1
  • GitVersion Tool/CommandLine: 5.6.10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
asbjornucommented, Jul 6, 2021

I don’t use Mainline myself, so I’m not sure what’s correct to expect and not. 🤷🏼‍♂️

1reaction
asbjornucommented, Jul 5, 2021

GitVersion doesn’t play nice with tags lower than 1.0.0. Are you able to reproduce this if you tag 1.0.0-alpha.41 instead?

Read more comments on GitHub >

github_iconTop Results From Across the Web

GitVersion jumping versions for a single untagged commit
The un-tagged commit should be 0.1.0-alpha.42 but GitVersion suggest 0.1.0-alpha0083 (i.e. previous version - 41 + CommitsSinceVersionSource - ...
Read more >
Configuration
If you are using next-version and are experiencing weird versioning behaviour, please remove it, create a git tag with an appropriate version number...
Read more >
Git - git-fetch Documentation
Set to "consecutive" to use an algorithm that walks over consecutive commits checking each one. Set to "skipping" to use an algorithm that...
Read more >
How to use GitVersion to get sensible versioning
Some rely on build numbers, some number them by hand by committing a version to source control, and some don't even care about...
Read more >
CHANGELOG.md · main · GitLab.org / gitlab-runner
Fix Windows IsRoot() path utility ! · Warn if runner with same token being registered multiple times ! · Upgrade taskscaler to latest...
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