quorumcontrol / dgit

dgit adds decentralized ownership to git - powered by Tupelo DLT and Skynet
https://dgit.dev/
MIT License
208 stars 16 forks source link

Add version command & compile in a version string #35

Closed cap10morgan closed 4 years ago

cap10morgan commented 4 years ago

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:

  1. 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).
  2. 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).
  3. 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).