This adds a dgit version command that just outputs dgit version [version string].
It also adds some logic to the Makefile to do one of the following when building the dgit binary:
If there is a git tag pointing at HEAD and the working directory is clean (untracked files are ignored here, for better or worse): version string will be the git tag (e.g. v0.0.8-alpha).
If there is a git tag pointing at HEAD but the working directory is NOT clean: version string will be the git tag pointing at HEAD with -dev appended to it (e.g. v0.0.8-alpha-dev).
If there is no git tag pointing at HEAD: the version string will be the short git SHA of the commit with -dev appended if the git working directory was not clean at build time (e.g. 1d781e1 for a clean build of git SHA 1d781e1 or 1d781e1-dev for a dirty build of git SHA 1d781e1 plus local uncommitted changes).
This adds a
dgit version
command that just outputsdgit version [version string]
.It also adds some logic to the Makefile to do one of the following when building the dgit binary:
v0.0.8-alpha
).-dev
appended to it (e.g.v0.0.8-alpha-dev
).-dev
appended if the git working directory was not clean at build time (e.g.1d781e1
for a clean build of git SHA1d781e1
or1d781e1-dev
for a dirty build of git SHA1d781e1
plus local uncommitted changes).