diff options
| author | Marvin W <git@larma.de> | 2025-04-11 19:22:51 +0200 |
|---|---|---|
| committer | Marvin W <git@larma.de> | 2025-04-11 19:22:51 +0200 |
| commit | 618af16bc775d90a5a4643efd1fa6b013606c2ee (patch) | |
| tree | 64733ed98631fa3461615582fb1fbb1052b01e00 | |
| parent | e23f2d8a6877c4d8137d1377db35cb963dd6e609 (diff) | |
Strip leading "v" from tag when generating display version
| -rw-r--r-- | libdino/version.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libdino/version.py b/libdino/version.py index dfbadb76..d057ddf2 100644 --- a/libdino/version.py +++ b/libdino/version.py @@ -26,7 +26,7 @@ def compute_version_from_git(git_repo, git): return None git_describe = subprocess.check_output([git, "describe", "--tags"], cwd=git_repo, text=True).strip() if git_release_tag == git_describe: - return git_release_tag + return git_release_tag[1:] matches = re.match("^.*-([0-9]+)-g([0-9a-f]+)$", git_describe) if matches is None: return None @@ -34,7 +34,7 @@ def compute_version_from_git(git_repo, git): git_commit_hash = matches.groups()[1] git_commit_time = subprocess.check_output([git, "show", "--format=%cd", "--date=format:%Y%m%d", "-s"], cwd=git_repo, text=True).strip() - return "%s~git%s.%s.%s" % (git_release_tag, git_tag_offset, git_commit_time, git_commit_hash) + return "%s~git%s.%s.%s" % (git_release_tag[1:], git_tag_offset, git_commit_time, git_commit_hash) except subprocess.CalledProcessError: pass return None |
