Remove %h from the VERSION file

git %(describe) is all we need.
This commit is contained in:
exquo 2022-01-05 13:07:07 +00:00
parent 5ba0e32486
commit 57fc759b9c
2 changed files with 5 additions and 4 deletions

View File

@ -1,4 +1,4 @@
$Format:%h %(describe:match=v*)$
$Format:%(describe:match=v*)$
# The format string above is expanded with values during the execution of

7
scli
View File

@ -140,10 +140,11 @@ def get_version():
version_str = f.readline()
except OSError:
return '?'
if version_str.startswith('$'):
# Neither a release, nor is there a `.git` dir (e.g. manually dl'ed blob)
if not version_str.startswith('v'):
# '$Format:...' - not a `git archive` (e.g. a manually dl'ed blob)
# '%(..)' - `git archive` if git < 2.32
return '?'
return version_str.split()[-1] # tag or commit hash
return version_str[1:] # `git-describe`-like string
def get_default_editor():