Skip to content

[Bug] Version not generated correct when creating a feature branch from a develop branch #3108

@HHobeck

Description

@HHobeck

Describe the bug
Hi there. I'm using the GitFlow branching strategy descripted on this page https://gitversion.net/docs/learn/branching-strategies/gitflow/examples. Because I want to ensure the stability of the develop direct committing is not allowed. Thus I need to go via feature branches and got an unexpected version generation on the following scenario:

[Test]
public void __Just_A_Test__()
{
    using var fixture = new EmptyRepositoryFixture();
    fixture.Repository.MakeATaggedCommit("1.0.0");
    fixture.BranchTo("develop");
    fixture.Repository.MakeACommit();
    fixture.Checkout("main");
    fixture.Repository.MakeACommit();
    fixture.Checkout("develop");
    fixture.BranchTo("feature/just-a-test");
    fixture.MergeNoFF("main");
    fixture.Repository.MakeACommit();
    var configuration = new Config()
    {
        Branches = new Dictionary<string, BranchConfig>()
        {
            { "release", new BranchConfig() { TracksReleaseBranches = true } }
        }
    };
    fixture.AssertFullSemver("1.0.1-just-a-test.1+4", configuration); // expected 1.1.0
}

That produces the following repository:

 * 1d22aeb 51 minutes ago  (HEAD -> feature/just-a-test)
 *   cb3fd3c 53 minutes ago 
 |\  
 | * 3df53ce 54 minutes ago  (main)
 * | e2ca7c9 56 minutes ago  (develop)
 |/  
 * 46ab60b 58 minutes ago  (tag: 1.0.0)

with following commit messages:
image

Expected Behavior

Git Version should generate the semantic version 1.1.0 on feature branch just-a-test in this scenario.

Actual Behavior

The semantic version 1.0.1 will be generated.

Possible Fix

I'm not sure if it is a bug or I have misconfigured something.

Steps to Reproduce

Please take look to the test steps above

Context

I'm using the latest version of GitVersion 5.10.1. My build and deployment pipelines are in AzureDevOps but I can reproduce it locally.

Your Environment

  • Version Used: 5.10.1
  • Operating System is Windows 10
  • Link to your project: n/a
  • Link to your CI build (if appropriate): n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions