- Debian Policy : https://www.debian.org/doc/debian-policy/ch-controlfields.html#version
- Upstream version:
upstream_version
- If upstream versioning is changed:
epoch
- Pre-release:
~
- Post-release:
+
- If upstream versioning is changed:
- Debian version:
debian_revision
- Upstream version:
- Guide for Debian Maintainers : https://www.debian.org/doc/manuals/debmake-doc/ch06.en.html#name-version
- (Pre)
0.0 < 0.5 < 0.10 < 0.99 < 1 < 1.0~rc1 < 1.0 < 1.0+b1 < 1.0+nmu1 < 1.1 < 2.0
(Post)
- (Pre)
- Debian Wiki : https://wiki.debian.org/Versioning
- ASCII table : https://en.wikipedia.org/wiki/ASCII#Character_set
- (Post)
+ > - > . > 0-9 > A-Z > a-z > ~
(Pre)
- (Post)
git --no-pager log -1 --date="format:%Y%m%d" --pretty="0.0~git%cd.%h"
0.0~git20150607.4976a6c
In case of the tag starts with numberic value
0.9.1
0.9
0.8
git --no-pager log -1 --date="format:%Y%m%d" --pretty="$(git describe)+git%cd.%h"
0.9.1+git20150607.4976a6c
In case of the tag starts with v
v0.9.1
v0.9
v0.8
git --no-pager log -1 --date="format:%Y%m%d" --pretty="$(git describe --tags --abbrev=0)+git%cd.%h" | sed 's/^v//'
# Note that ^v in sed can be replaced for your real cases
0.9.1+git20150607.4976a6c