aboutsummaryrefslogtreecommitdiff
path: root/modules/extensions.py
diff options
context:
space:
mode:
authorAUTOMATIC <16777216c@gmail.com>2023-05-15 21:22:35 +0300
committerAUTOMATIC <16777216c@gmail.com>2023-05-15 21:22:35 +0300
commita47abe1b7b667374e9df1932172230132d3fe8db (patch)
tree85952e9515481e7a768f6dc7a179359ce7754368 /modules/extensions.py
parent0d2a4b608c075daa3a4d1a1c9df01a763ae4793a (diff)
update extensions table: show branch, show date in separate column, and show version from tags if available
Diffstat (limited to 'modules/extensions.py')
-rw-r--r--modules/extensions.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/modules/extensions.py b/modules/extensions.py
index 1053253e..f16f059e 100644
--- a/modules/extensions.py
+++ b/modules/extensions.py
@@ -66,13 +66,11 @@ class Extension:
try:
self.status = 'unknown'
self.remote = next(repo.remote().urls, None)
- head = repo.head.commit
self.commit_date = repo.head.commit.committed_date
- ts = time.asctime(time.gmtime(self.commit_date))
if repo.active_branch:
self.branch = repo.active_branch.name
- self.commit_hash = head.hexsha
- self.version = f'{self.commit_hash[:8]} ({ts})'
+ self.commit_hash = repo.head.commit.hexsha
+ self.version = repo.git.describe("--always", "--tags") # compared to `self.commit_hash[:8]` this takes about 30% more time total but since we run it in parallel we don't care
except Exception as ex:
print(f"Failed reading extension data from Git repository ({self.name}): {ex}", file=sys.stderr)