Skip to content

GitVersionTask is generating an unexpectedly high version number #443

@asbjornu

Description

@asbjornu

As requested in shawnmclean/Mandrill-dotnet#98, I've tried to add GitVersionTask to make versioning in the project more stringent and predictable. Before adding GitVersionTask (version 3 beta 2), I created a develop branch and then a feature/git-version branch, which is the branch I've added it in. When I build that branch, the version number for some reason ends up as 4.0.1.0. The full GitVersionInformation class is as following:

[System.Runtime.CompilerServices.CompilerGenerated]
static class GitVersionInformation
{
    public static string Major = "4";
    public static string Minor = "0";
    public static string Patch = "1";
    public static string PreReleaseTag = "git-version.1";
    public static string PreReleaseTagWithDash = "-git-version.1";
    public static string BuildMetaData = "67";
    public static string FullBuildMetaData = "67.Branch.feature/git-version.Sha.5fdf5674d81fe68fa1c9496e0a128b8e1f6ed15b";
    public static string MajorMinorPatch = "4.0.1";
    public static string SemVer = "4.0.1-git-version.1";
    public static string LegacySemVer = "4.0.1-git-version1";
    public static string LegacySemVerPadded = "4.0.1-git-version0001";
    public static string AssemblySemVer = "4.0.1.0";
    public static string FullSemVer = "4.0.1-git-version.1+67";
    public static string InformationalVersion = "4.0.1-git-version.1+67.Branch.feature/git-version.Sha.5fdf5674d81fe68fa1c9496e0a128b8e1f6ed15b";
    public static string BranchName = "feature/git-version";
    public static string Sha = "5fdf5674d81fe68fa1c9496e0a128b8e1f6ed15b";
    public static string NuGetVersionV2 = "4.0.1-git-version0001";
    public static string NuGetVersion = "4.0.1-git-version0001";

}

The last tag on the master branch is v2.0.1. I'd expect the version of a feature branch to be 2.1.* or something similar and at most 3.*, so I wonder where those extra two major versions come from. Ideas?

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