"Git tag 1.0" results in file version "0.0.0.0"
See original GitHub issueVersion(s)
2.3.0
To reproduce
Steps to reproduce the behavior:
- Create a git tag
1.0 - Build Project
Expected behavior
Expect file version to be 1.0.0.0 (default to 0 for any missing version segments)
Actual behaviour
File version is 0.0.0.0
Workarounds
Always tag your repository with {Major}.{Minor}.{Patch}
Additional context
I would expect that creating a tag of just 1 should default a file version of 1.0.0.0
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Git - Tagging
A lightweight tag is very much like a branch that doesn't change — it's just a pointer to a specific commit. Annotated tags,...
Read more >Write "current" git tag to text file
In your series of statements, you're tagging the current HEAD with 1.0, but the version.txt contains 0.9. Tagging is just a marker on...
Read more >Git Tagging Explained
A guide for learning the git tag command and how it fits into the Git ... the GUID while associating it with version...
Read more >A Tutorial for Tagging Releases in Git
Tags are a simple aspect of Git, they allow you to identify specific release versions of your code. You can think of a...
Read more >How to use GitVersion to get sensible versioning
Git checkout main > Git tag 1.0.0 ... It'll give you the following output: > gitversion ... Let's change some files and commit...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

While I appreciate the spirit of the suggestions and the seconding thereof, I believe Adam’s stance is absolutely correct; though I’d like to add some further reasons…
Tags added by developers, and specific version suffixes etc feed into file names with wide-ranging implications. For instance, I’ve seen MinVer used as a commandline tool in repos where there’s lots of legacy tags of various forms Being tolerant of (and then needing to document the supported) permutations of aliases of equivalent versions would cause far more problems that it would solve.
What I was trying to say (obviously not well after a couple of drinks😁) is that a large audience for your component is going to be people, like myself, using this awesome component, manually tagging commits. Since it derives versions from git tags, I think any reasonable person would expect the tag
1.0would derive the file version1.0.0.0and not0.0.0.0, which is what felt like a bug or a gap since the result lost information.I understand the semantics of saying
2.0is inaccurate when meaning2.xwhen dealing with version ranges, but this isn’t about ranges, its about deriving version numbers from tags.The point software being a human effort is that often times we write component to be used by other developers vs components to be used by other components. So I think considering that audience, especially when they are either end users (obviously) or other developers, and setting reasonable defaults goes a long way for these components we write just working under broad circumstances. Maybe this is just my odd philosophy on software development and various aspects that I find important.