I found it a super smart idea to add the git revision number to my project version during the gradle build, like major.minor.commit. This is realized via
git rev-list --count HEAD
Now I'm using gitlab ci which only gets the latest 50 commits:
Fetching changes with git depth set to 50...
So I end up with a version number of 50 all the time. Long story short, how do I get the correct count with a shallow git clone?