We're using this command to get version and revision from git:
git describe --always --tags --dirty
It returns
gcc7b71f
)v2.1.0
, used for releases)v5.3.0-88-gcc7b71f
)v5.3.0-88-gcc7b71f-dirty
)See also: https://www.git-scm.com/docs/git-describe#Documentation/git-describe.txt