Closed kost-samsonov closed 1 week ago
Please consider sponsoring to help prioritize issues 🙏.
As documented in the targets and readme:
$(GitTagRegex): regular expression used with git describe to filter the tags to consider for base version lookup. Defaults to * (all).
You could default it to $(GitBaseVersionRegex)
via a Directory.Build.targets
or use its value (or a simplified version):
<GitBaseVersionRegex Condition="'$(GitBaseVersionRegex)' == ''">v?(?<MAJOR>\d+)\.(?<MINOR>\d+)(?:\-(?<LABEL>[\dA-Za-z\-\.]+))?$|^v?(?<MAJOR>\d+)\.(?<MINOR>\d+)\.(?<PATCH>\d+)(?:\-(?<LABEL>[\dA-Za-z\-\.]+))?$|^(?<LABEL>[\dA-Za-z\-\.]+)\-v?(?<MAJOR>\d+)\.(?<MINOR>\d+)\.(?<PATCH>\d+)$</GitBaseVersionRegex>
For example:
<PropertyGroup>
<GitTagRegex>v?\d+\.\d+\.\d?</GitTagRegex>
</PropertyGroup>
In this case, the targets would run git describe --tags --match=v?\d+\.\d+\.\d? --abbrev=0
Describe the Bug
Tag without version drop semver to zeros
Steps to Reproduce
run powershell with net7.0 dotnet cli
output contains
output contains
but must get read first right tag with version from commits below
Expected Behavior
Version Info
GitInfo 3.3.3