version: calculate version info without using git tags.

This makes it easier to integrate this version math into a submodule-ful
world. We'll continue to have regular git tags that parallel the information
in VERSION, so that builds out of this repository behave the same.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-10-29 00:17:36 -07:00
committed by Dave Anderson
parent 710b105f38
commit 437142daa5
4 changed files with 30 additions and 6 deletions

View File

@@ -11,10 +11,8 @@
set -euo pipefail
describe=$(git describe --long --abbrev=9)
# --abbrev=200 is an arbitrary large number to capture the entire git
# hash without trying to compact it.
commit=$(git describe --dirty --exclude "*" --always --abbrev=200)
describe=$(./version/describe.sh)
commit=$(git rev-parse --verify --quiet HEAD)
long=$(./version/mkversion.sh long "$describe" "")
short=$(./version/mkversion.sh short "$describe" "")