version: use -g as the "other" suffix, so that git show works.

Fixes #880.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson 2020-10-30 13:03:46 -07:00 committed by Dave Anderson
parent f3aa08de76
commit 710b105f38
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ fi
# used and Go toolchain version).
if [ -n "$other" ]; then
other="$(echo $other | cut -c1-9)"
other="-o${other}"
other="-g${other}"
fi
# Validate that the version data makes sense. Rules:

View File

@ -47,7 +47,7 @@ func TestMkversion(t *testing.T) {
{"v0.98-123-gabcdef", "", true, "0.0.0-tabcdef", "0.0.0", xcode("0.0.0", "100.0.0")},
{"v1.0.0-37-gabcdef", "", true, "0.0.0-tabcdef", "0.0.0", xcode("0.0.0", "100.0.0")},
{"v1.1.0-129-gabcdef", "0123456789abcdef0123456789abcdef", true, "1.1.1129-tabcdef-o012345678", "1.1.1129", xcode("1.1.1129", "101.1.1129")},
{"v1.1.0-129-gabcdef", "0123456789abcdef0123456789abcdef", true, "1.1.1129-tabcdef-g012345678", "1.1.1129", xcode("1.1.1129", "101.1.1129")},
{"v0.99.5-0-gabcdef", "", false, "", "", ""}, // unstable, patch not allowed
{"v0.99.5-123-gabcdef", "", false, "", "", ""}, // unstable, patch not allowed
{"v1-gabcdef", "", false, "", "", ""}, // bad semver