Git height set to 0 when version.json file has wrong capitalization
See original GitHub issueI can’t make my VSTS CI use the Git height. I can’t figure out what I’m missing.
The “Get sources” VSTS task has “Shallow fetch” unchecked.
I’m using a private build agent and I can see that the “.git” folder is present.
The “dotnet pack” VSTS task has “Automatic package versioning” set to “Off”.
GitVersioning: v2.1.16 Version.json:
{
"$schema": "https://raw.githubusercontent.com/AArnott/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json",
"version": "1.1-alpha",
"nugetPackageVersion": {
"semVer": 2
},
"cloudBuild": {
"setVersionVariables": true,
"buildNumber": {
"enabled": true
}
},
"publicReleaseRefSpec": [
"^refs/heads/master$" // we release out of master
]
}
Issue Analytics
- State:
- Created 6 years ago
- Comments:7
Top Results From Across the Web
Git height set to 0 when version.json file has wrong ...
GV calculates a height of zero. The only time I've seen this is when version.json isn't actually committed into source control. Can you...
Read more >How do you change the capitalization of filenames in Git?
It will lowercase all files in a folder. If you want to change the file name to uppercase , you can simply go...
Read more >User and Workspace Settings
Open the settings. json file with the Preferences: Open User Settings (JSON) command and you should see the error highlighted with red squiggles....
Read more >Don't Change the Capitalization of Your Filenames!
The problem occurs when a file that is already git-committed is renamed, but only with changes to its capitalization (lowercase / Uppercase).
Read more >Load JSON - APOC Extended Documentation
This procedure takes a file or HTTP URL and parses the JSON into a map data structure. It is a more configurable version...
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
Oh, wow. Nice catch. I’ll chalk that up to when we read the current version, we just use the case-insensitive file system to find it, but when we search git history, we are now using git which is case sensitive, so we can’t find it and treat it like it isn’t checked in.
Found the issue! It’s case sensitive! The file was called “Version.json”. Lowercasing the v makes it work. I was rulling that out because the hash was being added to the version number. Thanks for the help!