use describe --all to always get a description

This commit is contained in:
Thomas Vander Stichele
2014-03-26 09:44:19 -04:00
parent 7f1521d50f
commit c6161b35f9

View File

@@ -351,14 +351,15 @@ def getRevision():
# which may be higher than your current source tree
if os.path.exists(os.path.join(topsrcdir, '.git')):
status, describe = commands.getstatusoutput('git describe')
# always falls back to the current commit hash if no tags are found
status, describe = commands.getstatusoutput('git describe --all')
if status == 0:
if commands.getoutput('git diff-index --name-only HEAD --'):
describe += '-modified'
return describe
# check for a top-level REIVISION file
# check for a top-level REVISION file
path = os.path.join(topsrcdir, 'REVISION')
if os.path.exists(path):
revision = open(path).read().strip()