Skip to content

Commit bb071c0

Browse files
authored
Merge pull request #3441 from HHobeck/feature/3438_Consider-pre-release-tags-only-when-they-matching-with-the-label-name-on-branch
Consider pre-release tags only when they matching with the label name on branch
2 parents b0f6c77 + e2e31e3 commit bb071c0

26 files changed

+1118
-214
lines changed

BREAKING_CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
* Following root configuration properties have been removed:
2424
* continuous-delivery-fallback-tag
2525
* A new branch related property with name `track-merge-message` has been introduced. Consider we have a `main` branch and a `release/1.0.0` branch and merge changes from `release/1.0.0` to the main branch. In this scenario the merge message will be interpreted as a next version `1.0.0` when `track-merge-message` is set to `true` otherwise `0.0.1`.
26+
* The pre-release tags are only considered when they are matching with the label name of the branch. This has an effect on the way how the `CommitCountSource` will be determined.
27+
* The process of increasing the version with bump message when `CommitMessageIncrementing` is enabled and increment strategy is `None` has been changed.
2628
2729
## v5.0.0
2830

src/GitVersion.Core.Tests/IntegrationTests/DevelopScenarios.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ public void WhenDevelopHasMultipleCommitsSpecifyNonExistingCommitId()
4444
public void WhenDevelopBranchedFromTaggedCommitOnMainVersionDoesNotChange()
4545
{
4646
using var fixture = new EmptyRepositoryFixture();
47-
fixture.Repository.MakeATaggedCommit("1.0.0");
48-
Commands.Checkout(fixture.Repository, fixture.Repository.CreateBranch("develop"));
47+
fixture.MakeATaggedCommit("1.0.0");
48+
fixture.BranchTo("develop");
4949
fixture.AssertFullSemver("1.0.0");
5050
}
5151

src/GitVersion.Core.Tests/IntegrationTests/DocumentationSamples.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public void GitFlowMinorRelease()
136136

137137
// Make a commit after a tag should bump up the beta
138138
fixture.MakeACommit();
139-
fixture.AssertFullSemver("1.3.0-beta.2+2");
139+
fixture.AssertFullSemver("1.3.0-beta.2+1");
140140

141141
// Complete release
142142
fixture.Checkout(MainBranch);
@@ -191,7 +191,7 @@ public void GitFlowMajorRelease()
191191

192192
// Make a commit after a tag should bump up the beta
193193
fixture.MakeACommit();
194-
fixture.AssertFullSemver("2.0.0-beta.2+2");
194+
fixture.AssertFullSemver("2.0.0-beta.2+1");
195195

196196
// Complete release
197197
fixture.Checkout(MainBranch);
@@ -380,11 +380,11 @@ public void GitHubFlowMajorRelease()
380380

381381
// test that the CommitsSinceVersionSource should still return commit count
382382
var version = fixture.GetVersion();
383-
version.CommitsSinceVersionSource.ShouldBe("2");
383+
version.CommitsSinceVersionSource.ShouldBe("0");
384384

385385
// Make a commit after a tag should bump up the beta
386386
fixture.MakeACommit();
387-
fixture.AssertFullSemver("2.0.0-beta.2+3");
387+
fixture.AssertFullSemver("2.0.0-beta.2+1");
388388

389389
// Complete release
390390
fixture.Checkout(MainBranch);

src/GitVersion.Core.Tests/IntegrationTests/HotfixBranchScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public void PatchLatestReleaseExample()
2525
fixture.Repository.ApplyTag("1.2.1-beta.1");
2626
fixture.AssertFullSemver("1.2.1-beta.1");
2727
fixture.Repository.MakeACommit();
28-
fixture.AssertFullSemver("1.2.1-beta.2+3");
28+
fixture.AssertFullSemver("1.2.1-beta.2+1");
2929

3030
// Merge hotfix branch to main
3131
Commands.Checkout(fixture.Repository, MainBranch);

src/GitVersion.Core.Tests/IntegrationTests/MainScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ public void PreventDecrementationOfVersionsOnTheDevelopmentBranch()
330330
fixture.MergeNoFF("develop");
331331

332332
// ✅ succeeds as expected
333-
fixture.AssertFullSemver("1.0.0-beta.2+2", configurationBuilder.Build());
333+
fixture.AssertFullSemver("1.0.0-beta.2+3", configurationBuilder.Build());
334334

335335
fixture.Checkout("develop");
336336

src/GitVersion.Core.Tests/IntegrationTests/OtherBranchScenarios.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public void ShouldNotGetVersionFromFeatureBranchIfNotMerged()
5353
fixture.MakeATaggedCommit("1.0.1-feature.1");
5454
fixture.Checkout(MainBranch);
5555
fixture.BranchTo("develop");
56-
fixture.Repository.MakeACommit();
56+
fixture.MakeACommit();
5757

58-
fixture.AssertFullSemver("1.0.0-alpha.1", configuration);
58+
fixture.AssertFullSemver("1.0.0-alpha.2", configuration);
5959

6060
fixture.Repository.DumpGraph();
6161
}

0 commit comments

Comments
 (0)