aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2022-06-01 12:09:36 -0700
committerGravatar MarkKoz <[email protected]>2022-06-01 12:09:36 -0700
commit1a443375e0fda4d9fa046ff9b22f7dbcb88d2691 (patch)
tree8c5100c46f94e0218172b343270295116c3fcdfb
parentMerge #140 - add pyproject.toml and versioning (diff)
Fix commit count part of version being off by 1
-rw-r--r--scripts/version.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/version.py b/scripts/version.py
index bf8d509..62ff07e 100644
--- a/scripts/version.py
+++ b/scripts/version.py
@@ -31,7 +31,8 @@ def count_commits_on_date(dt: datetime.datetime) -> int:
args = ["git", "log", "--oneline", "--after", str(dt.timestamp())]
stdout = subprocess.check_output(args, text=True)
- return stdout.strip().count("\n")
+ # The last newline is stripped, so it has to be manually counted with + 1.
+ return stdout.strip().count("\n") + 1
if __name__ == "__main__":