question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Git height set to 0 when version.json file has wrong capitalization

See original GitHub issue

I 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”.

2018-01-25 15_34_54-datasonar net-ci summary

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:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
AArnottcommented, Jan 26, 2018

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.

1reaction
aalmadacommented, Jan 26, 2018

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found