From 7dc4e00c75ff7aaf83f08674005b7ea4dab14e1c Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 26 Nov 2024 06:10:03 -0800 Subject: [PATCH] feat: dynamically determine base version for history updates --- scripts/update-history.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/scripts/update-history.py b/scripts/update-history.py index d1a4c98de..c7a3be5c2 100644 --- a/scripts/update-history.py +++ b/scripts/update-history.py @@ -3,10 +3,21 @@ import os import subprocess import tempfile +import re +from aider import __version__ + + +def get_base_version(): + # Parse current version like "0.64.2.dev" to get major.minor + match = re.match(r"(\d+\.\d+)", __version__) + if not match: + raise ValueError(f"Could not parse version: {__version__}") + return match.group(1) + ".0" def run_git_log(): - cmd = ["git", "log", "-p", "v0.64.0..HEAD", "--", "aider/", ":!aider/website/", ":!HISTORY.md"] + base_ver = get_base_version() + cmd = ["git", "log", "-p", f"v{base_ver}..HEAD", "--", "aider/", ":!aider/website/", ":!HISTORY.md"] result = subprocess.run(cmd, capture_output=True, text=True) return result.stdout