|
@@ -2,7 +2,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-import re
|
|
|
|
import os
|
|
import os
|
|
import shlex
|
|
import shlex
|
|
import subprocess
|
|
import subprocess
|
|
@@ -59,25 +58,8 @@ def get_git_url_and_branch():
|
|
|
|
|
|
|
|
|
|
def get_git_version():
|
|
def get_git_version():
|
|
- try:
|
|
+ git_commit_date_hash = subprocess_run(r"git show -s --format='%cs-%h'").replace("-", ".", 2)
|
|
- tag = subprocess_run("git describe HEAD")
|
|
+ tag_version = git_version = git_commit_date_hash
|
|
-
|
|
|
|
-
|
|
|
|
- tag_version, tag_distance, tag_commit = (tag.split("-") + ["", ""])[:3]
|
|
|
|
- if re.match(r"v[0-9]+\.[0-9]+\.[0-9]+", tag_version):
|
|
|
|
-
|
|
|
|
-
|
|
|
|
- tag_version = tag_version[1:]
|
|
|
|
-
|
|
|
|
- if tag_commit and tag_commit[0] == "g":
|
|
|
|
- tag_commit = tag_commit[1:]
|
|
|
|
-
|
|
|
|
- git_version = "-".join(filter(bool, [tag_version, tag_distance, tag_commit]))
|
|
|
|
- except subprocess.CalledProcessError:
|
|
|
|
-
|
|
|
|
- git_version = subprocess_run(r"git show -s --format='%as-%h'")
|
|
|
|
-
|
|
|
|
- tag_version = git_version = git_version.replace("-", ".")
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
try:
|