Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Adding git describe --tags [--long] in properties #18

Open
sebastiano-pera-netventure opened this issue Dec 31, 2024 · 1 comment
Open
Labels

Comments

@sebastiano-pera-netventure
Copy link

sebastiano-pera-netventure commented Dec 31, 2024

Hello, thanks a lot for this extremely useful library.
There are only 2 things I would really like to see as output, which are the git describe --tags and the git describe --tags --long commands.

An example output is

C:\MyRepo\>  git describe --tags
v2.0.0-alpha

And in cases I add some commits to the previous branch I get an incremental counter for each commit and the short hash version, which is similar to the command

C:\MyRepo\>  git describe --tags --long
v2.0.0-alpha-0-g45b7bed

I think it is extremely useful because it is for most cases self-explainatory and safe because I don't think it can generate duplicates.

Is there a reason why they are not included already?

Or otherwise, how do I obtain the full tag name with the trailing strings like "-alpha" or "-RC1"?

Thanks

@sebastiano-pera-netventure sebastiano-pera-netventure changed the title Adding git describe --tags_ in properties and tag property Adding _git describe --tags_ in properties and tag property Dec 31, 2024
@sebastiano-pera-netventure sebastiano-pera-netventure changed the title Adding _git describe --tags_ in properties and tag property Adding git describe --tags [--long] in properties Dec 31, 2024
@kekyo
Copy link
Owner

kekyo commented Jan 23, 2025

@sebastiano-pera-netventure Sorry later.

I see, the original RelaxVersioner project was mainly intended to automatically apply the version number of .NET (Win32 resource) and to distinguish between “Strong-named assemblies” based on this. Therefore, it is assumed that the version to be applied is only whole number separated by dots, such as 0.1.2.3.

You can embed any string as information in the AssemblyInformationalVersion attribute, but even in such cases you must specify some kind of dot-separated integer in the AssemblyVersion attribute.
This means that you cannot apply version addition information (separated by hyphens) to assemblies no matter what you do.

Due to the pressure from the world to adopt SemVer 2.0, it is possible to add SHA to the AssemblyInformationalVersion attribute, but as I am not enthusiastic about SemVer, I have not checked whether it is consistent with the operation method that assumes SemVer.

(Despite the benefits of SemVer, when we CI/CD .NET projects, we are inevitably aware of the issue of how to handle package versioning).

For that reason, it may be possible to output version numbers separated by hyphens using a rules file, but I do not actively verify this.

@kekyo kekyo added the question label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants