Report a useful version number
tartley opened this issue · comments
When users look in the store at our snap, or consult "snap info universal-ctags", they see version numbers of the form:
- major = 0
- minor = 2
- patch = (hyphen separated):
- year
- month
- date
- first 8 chars of universal-ctags commit from which this build was made
eg. 0.2.2018-09-21-39e840e6
When users run ctags --version
on the installed snap, the reported version information includes both the 8 character git commit and the date of compilation, so these will be visibly comparable.
I'm wondering about whether to make the timestamp embedded in the version contain the hour-minute-second too, so that multiple releases made on the same day, from different commits, will be ordered correctly.
- 0.2.2019-09-21-39e840e6
vs
- 0.2.2019-09-21-21-43-55-39e840e6
"Snap versions consist of upper- and lower-case alphanumeric characters, as well as periods, colons, plus signs, tildes, and hyphens. They cannot begin or end with a period, colon, or hyphen. They cannot begin with plus sign, tilde."
So we could do
- 0.2.2019-09-21+21:43:55+39e840e6
$ git show --format="%ci %h" -s | cut -d' ' -f1-2,4 | tr ' ' '+'
2019-09-20+13:49:53+39e840e6