-
Describe the bug
The problem is GitVersion don't catch new commits that are pushed to release branch (for example cherry-picks from main branch in case of hotfixes). The version stays the same, but Patch number should be incremented. For example:
Property Current configuration I have:
Expected BehaviorAfter pushing new commits to release branch, Patch number should be incremented accordingly. Actual BehaviorPatch number does not get incremented. Is something wrong with my current configuration? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
This issue seems to me not a bug report. Pleases create only bugs if you are sure it is a bug. Questions like: "Is something wrong with my current configuration?" might be an contra indication of that. :) Please use the discussion forum! Bugs needs to have clear defined steps to reproduce and the used version number. |
Beta Was this translation helpful? Give feedback.
-
I have tried to reproduce your issue but the result is like you would expecting it. Please see the following integration test: public class MainlineDevelopmentMode3674 : TestBase
{
private static IGitVersionConfiguration GetMainlineModeConfiguration() => GitFlowConfigurationBuilder.New
.WithVersioningMode(VersioningMode.Mainline).WithLabel(null)
.WithSemanticVersionFormat(SemanticVersionFormat.Loose)
.WithBranch("develop", builder => builder
.WithVersioningMode(VersioningMode.Mainline)
.WithRegularExpression("^main")
.WithIncrement(IncrementStrategy.Minor)
.WithIsMainline(true)
.WithLabel(null)
).WithBranch("release", builder => builder
.WithVersioningMode(VersioningMode.Mainline)
.WithIncrement(IncrementStrategy.Patch)
.WithIsMainline(true)
.WithIsReleaseBranch(true)
.WithLabel(null)
).Build();
[Test]
public void JustATest()
{
var configuration = GetMainlineModeConfiguration();
using var fixture = new EmptyRepositoryFixture("main");
fixture.Repository.MakeATaggedCommit("1.0.0");
fixture.Repository.MakeACommit();
fixture.Repository.MakeACommit();
// ✅ succeeds as expected
fixture.AssertFullSemver("1.2.0", configuration);
fixture.BranchTo("release/1.2");
// ✅ succeeds as expected
fixture.AssertFullSemver("1.2.0", configuration);
fixture.Repository.MakeACommit("two");
fixture.Repository.MakeACommit("three");
// ✅ succeeds as expected
fixture.AssertFullSemver("1.2.2", configuration);
}
} Probably you need to specify is-mainline on release and feature branch as well. The above test targeting 6.0.0-beta.3 pre-release version of git version but there is nothing against working in latest as well. Happy branching! |
Beta Was this translation helpful? Give feedback.
I have tried to reproduce your issue but the result is like you would expecting it. Please see the following integration test: