summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-09 17:44:32 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-09 17:44:32 +0200
commitd414455b1a74cbd6caeaaf2b1aa5b4899c24d864 (patch)
tree3e3b1580efb7fa60d4d99e70cbcdb6e40f638ca3
parent0bb39e9abdc3ea42818289d2e5126c846b2a9b91 (diff)
downloadwumpus-hunter-d414455b1a74cbd6caeaaf2b1aa5b4899c24d864.tar.gz
total run count; fix date to be commit date, not author date
Signed-off-by: Lars Wirzenius <liw@liw.fi>
-rwxr-xr-xwumpus-hunter8
1 files changed, 5 insertions, 3 deletions
diff --git a/wumpus-hunter b/wumpus-hunter
index 1ab4ab1..23e5d22 100755
--- a/wumpus-hunter
+++ b/wumpus-hunter
@@ -212,14 +212,14 @@ def git_commit_date(dirname, commit):
try:
out = git(
"show",
- "--pretty=medium",
+ "--pretty=fuller",
"--date=iso",
commit,
cwd=dirname,
)
except Exception:
return "(unknown commit)"
- prefix = "Date:"
+ prefix = "CommitDate:"
date = [line.strip() for line in out.splitlines() if line.startswith(prefix)][0]
if date.startswith(prefix):
date = date[len(prefix) :].strip()
@@ -228,8 +228,10 @@ def git_commit_date(dirname, commit):
def count(src, counts, stats):
d = {}
+ total = 0
with open(stats) as f:
for line in f:
+ total += 1
(commit, result) = line.split()
if commit not in d:
d[commit] = (0, 0)
@@ -262,7 +264,7 @@ def count(src, counts, stats):
)
f.write("</table>\n")
timestamp = time.strftime("%Y-%m-%d %H:%M:%S %z")
- f.write(f"<p>Last updated {timestamp}</p>\n")
+ f.write(f"<p>Total of {total} test runs. Last updated {timestamp}</p>\n")
f.write("</body>\n")
f.write("</html>\n")