[X] I have searched issues to ensure it has not already been reported
GitVersion package
GitVersion.Tool
GitVersion version
6.0.2
Operating system
Windows
What are you seeing?
GitVersion seems to be ignoring the most recent tag on main and performing the calculation from an old tag.
The command below shows the version being returned is v2.0.8, but based on the log I'd expect to see v2.1.1
> dotnet-gitversion -diag
INFO [24-09-18 21:50:26:86] Please run `git log --graph --format="%h %cr %d" --decorate --date=relative --all --remotes=*` to see the git graph. This can help you troubleshoot any issues.
INFO [24-09-18 21:50:26:86] Working directory: C:\git\project
INFO [24-09-18 21:50:26:91] Project root is: C:\git\project\
INFO [24-09-18 21:50:26:92] DotGit directory is: C:\git\project\.git
INFO [24-09-18 21:50:26:92] Branch from build environment:
INFO [24-09-18 21:50:26:92] Found configuration file at 'C:\git\project\GitVersion.yml'
INFO [24-09-18 21:50:27:34] Using latest commit on specified branch
INFO [24-09-18 21:50:27:39] Getting tagged semantic versions. TagPrefix: [vV] and Format: Strict
INFO [24-09-18 21:50:28:26] Running against branch: main ('2cf66dd' - Upgrade to .net 8 & rev all dependent packages (#136))
INFO [24-09-18 21:50:28:27] -< Begin: Fetching the base versions for version calculation... >-
INFO [24-09-18 21:50:28:27] Calculating base versions for 'main'
INFO [24-09-18 21:50:28:27] -< Begin: [Using 'ConfiguredNextVersionVersionStrategy' strategy] >-
INFO [24-09-18 21:50:28:28] -< End: [Using 'ConfiguredNextVersionVersionStrategy' strategy] (Took: 1.15ms) >-
INFO [24-09-18 21:50:28:28] -< Begin: [Using 'MainlineVersionStrategy' strategy] >-
INFO [24-09-18 21:50:28:28] -< Begin: Getting tagged semantic versions on branch 'refs/heads/main'. TagPrefix: [vV] and Format: Strict >-
INFO [24-09-18 21:50:28:29] -< End: Getting tagged semantic versions on branch 'refs/heads/main'. TagPrefix: [vV] and Format: Strict (Took: 3.87ms) >-
INFO [24-09-18 21:50:28:33] -< Begin: Finding branches source of 'main' >-
INFO [24-09-18 21:50:28:36] -< End: Finding branches source of 'main' (Took: 36.02ms) >-
INFO [24-09-18 21:50:28:39] CommitOnTrunk: Force version increment '2.0.7-1' +semver 'Patch' with label '' based on commit '347d59e'.
INFO [24-09-18 21:50:28:39] -< End: [Using 'MainlineVersionStrategy' strategy] (Took: 117.50ms) >-
INFO [24-09-18 21:50:28:39] -< Begin: [Using 'MergeMessageVersionStrategy' strategy] >-
INFO [24-09-18 21:50:28:40] -< End: [Using 'MergeMessageVersionStrategy' strategy] (Took: 1.47ms) >-
INFO [24-09-18 21:50:28:40] -< Begin: [Using 'TaggedCommitVersionStrategy' strategy] >-
INFO [24-09-18 21:50:28:40] -< End: [Using 'TaggedCommitVersionStrategy' strategy] (Took: 1.02ms) >-
INFO [24-09-18 21:50:28:40] -< Begin: [Using 'TrackReleaseBranchesVersionStrategy' strategy] >-
INFO [24-09-18 21:50:28:40] -< End: [Using 'TrackReleaseBranchesVersionStrategy' strategy] (Took: 0.82ms) >-
INFO [24-09-18 21:50:28:40] -< Begin: [Using 'VersionInBranchNameVersionStrategy' strategy] >-
INFO [24-09-18 21:50:28:40] -< End: [Using 'VersionInBranchNameVersionStrategy' strategy] (Took: 0.82ms) >-
INFO [24-09-18 21:50:28:40] -< End: Fetching the base versions for version calculation... (Took: 131.91ms) >-
INFO [24-09-18 21:50:28:40] -------------------------------------------------------
INFO [24-09-18 21:50:28:40] Base version used: CommitOnTrunk: Take '2.0.7-1' based on commit '347d59e'.
INFO [24-09-18 21:50:28:40] -------------------------------------------------------
INFO [24-09-18 21:50:28:40] -< Begin: Using continuous deployment workflow to calculate the incremented version. >-
INFO [24-09-18 21:50:28:41] 1 commits found between '347d59e' - Separate sample generation into individual scripts (resolves #133) and '2cf66dd' - Upgrade to .net 8 & rev all dependent packages (#136)
INFO [24-09-18 21:50:28:41] -< End: Using continuous deployment workflow to calculate the incremented version. (Took: 4.19ms) >-
INFO [24-09-18 21:50:28:41] Found configuration file at 'C:\git\project\GitVersion.yml'
Executing GenerateSetVersionMessage for 'LocalBuild'.
Executing GenerateBuildLogOutput for 'LocalBuild'.
{
"AssemblySemFileVer": "2.0.8.0",
"AssemblySemVer": "2.0.8.0",
"BranchName": "main",
"BuildMetaData": null,
"CommitDate": "2024-09-17",
"CommitsSinceVersionSource": 1,
"EscapedBranchName": "main",
"FullBuildMetaData": "Branch.main.Sha.2cf66dd43029ba7b4450fb078fc78a6c3c07b16f",
"FullSemVer": "2.0.8",
"InformationalVersion": "2.0.8+Branch.main.Sha.2cf66dd43029ba7b4450fb078fc78a6c3c07b16f",
"Major": 2,
"MajorMinorPatch": "2.0.8",
"Minor": 0,
"Patch": 8,
"PreReleaseLabel": "",
"PreReleaseLabelWithDash": "",
"PreReleaseNumber": null,
"PreReleaseTag": "",
"PreReleaseTagWithDash": "",
"SemVer": "2.0.8",
"Sha": "2cf66dd43029ba7b4450fb078fc78a6c3c07b16f",
"ShortSha": "2cf66dd",
"UncommittedChanges": 3,
"VersionSourceSha": "347d59eb5600e041dffcecd5444eb30a706b9d8c",
"WeightedPreReleaseNumber": 60000
}
> git log --graph --format="%h %cr %d" --decorate --date=relative --all --remotes=*
* 8e2704d 3 hours ago (refs/stash)
|\
| * 43f75d8 3 hours ago
|/
* 2cf66dd 29 hours ago (HEAD -> main, tag: v2.1, origin/main, origin/HEAD, mac/141-versioning-not-incrementing-properly)
| * 9b519e2 35 hours ago (origin/markcandelora-readme-update)
| * f01777d 35 hours ago (markcandelora-readme-update)
| |\
| | * 8adaa81 2 days ago
| * | 9344e4a 35 hours ago
| |/
| * 6bc2984 2 days ago
| * aa97334 2 days ago
| * 6306b43 2 days ago
| |\
| | * 4df2b1f 2 days ago
| * | f31332c 2 days ago
| * | 1edce84 2 days ago
| |/
| * 6e60031 2 days ago
| * cac27dd 2 days ago
| * 20a84e6 2 days ago
| * f854b41 6 days ago
| * c6f5a73 7 days ago
| * 14f04c5 7 days ago
| * 47c1291 7 days ago
| * d28ca1e 7 days ago
| * bdabcea 7 days ago
| * 1296b2f 7 days ago
|/
* 347d59e 1 year, 3 months ago
* b748394 1 year, 3 months ago
* 9ed98da 1 year, 3 months ago
* fc7510f 1 year, 3 months ago
* 7f2a52c 1 year, 3 months ago
* 5a5a3c2 1 year, 3 months ago
* ccfc352 1 year, 4 months ago
* 105d44a 1 year, 4 months ago (tag: v2.0)
Prerequisites
GitVersion package
GitVersion.Tool
GitVersion version
6.0.2
Operating system
Windows
What are you seeing?
GitVersion seems to be ignoring the most recent tag on main and performing the calculation from an old tag.
The command below shows the version being returned is v2.0.8, but based on the log I'd expect to see v2.1.1
What is expected?
v2.1.1
Steps to Reproduce
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
No response