Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[ISSUE]: Semver doesn't include prerelease tags in Git Tag #4384

Closed
2 tasks done
agocke opened this issue Jan 20, 2025 · 1 comment
Closed
2 tasks done

[ISSUE]: Semver doesn't include prerelease tags in Git Tag #4384

agocke opened this issue Jan 20, 2025 · 1 comment

Comments

@agocke
Copy link

agocke commented Jan 20, 2025

Prerequisites

  • I have written a descriptive issue title
  • I have searched issues to ensure it has not already been reported

GitVersion package

GitVersion.Tool

GitVersion version

6.1.0

Operating system

macOS

What are you seeing?

{
  "AssemblySemFileVer": "0.7.4.0",
  "AssemblySemVer": "0.7.4.0",
  "BranchName": "(no branch)",
  "BuildMetaData": 4,
  "CommitDate": "2025-01-20",
  "CommitsSinceVersionSource": 4,
  "EscapedBranchName": "-no-branch-",
  "FullBuildMetaData": "4.Branch.-no-branch-.Sha.a34a1af4aa6ef6fc971fcabbef994e909c2616b9",
  "FullSemVer": "0.7.4--no-branch-.1+4",
  "InformationalVersion": "0.7.4--no-branch-.1+4.Branch.-no-branch-.Sha.a34a1af4aa6ef6fc971fcabbef994e909c2616b9",
  "Major": 0,
  "MajorMinorPatch": "0.7.4",
  "Minor": 7,
  "Patch": 4,
  "PreReleaseLabel": "-no-branch-",
  "PreReleaseLabelWithDash": "--no-branch-",
  "PreReleaseNumber": 1,
  "PreReleaseTag": "-no-branch-.1",
  "PreReleaseTagWithDash": "--no-branch-.1",
  "SemVer": "0.7.4--no-branch-.1",
  "Sha": "a34a1af4aa6ef6fc971fcabbef994e909c2616b9",
  "ShortSha": "a34a1af",
  "UncommittedChanges": 1,
  "VersionSourceSha": "e2d7a2e1cb71ef64bcdcb483ec125239b3961d2c",
  "WeightedPreReleaseNumber": 1
}

What is expected?

I'm running the default config and have a tag called "v0.7.4-preview.1". I would expect that the detected semver for this tag would be "0.7.4-preview.1", but the results are instead the above.

Steps to Reproduce

Create a repository with a tag v0.7.4-preview.1 and checkout that tag. Run dotnet gitversion.

RepositoryFixture Test

No response

Output log or link to your CI build (if appropriate).

@HHobeck
Copy link
Contributor

HHobeck commented Jan 29, 2025

Dear @agocke,

First of all I want to say that for me it is not clear:

  • how your repository looks like
  • what branch you have used to create the tag

If you checkout a tag then gitversion tries to detect the branch and calculates the next version based on this branch. Normally no branch will be detected if two or more branches are part of the tag (in my opinion this behavior should be changed). Please see the following issue:

Please notice that only this tags are used (by detecting the pre-release number) when the label of the branch matches the pre-release label of the tag. If you want to detect all pre-release tags with different labels on lets say main you need to change the configuration (by setting the label to null):

workflow: 'GitFlow/v1'
label:
branches:
  main:
    label:

I'm going to close this issue because I think it will be addressed in #4212.

Happy Branching!

@HHobeck HHobeck closed this as completed Jan 29, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants