build: Use git describe --always

Add --always flag to "git describe" command to get a build identifier
even if one checks out the repo with a depth parameter that prunes out
the last tagged version.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
(cherry picked from commit a3c93bd81d)
This commit is contained in:
Kevin O'Connor 2018-02-27 11:27:59 -05:00 committed by Gerd Hoffmann
parent 63451fca13
commit 5d9a515002
1 changed files with 1 additions and 1 deletions

View File

@ -36,7 +36,7 @@ def git_version():
if not os.path.exists('.git'):
logging.debug("No '.git' file/directory found")
return ""
ver = check_output("git describe --tags --long --dirty").strip()
ver = check_output("git describe --always --tags --long --dirty").strip()
logging.debug("Got git version: %s" % (repr(ver),))
return ver