From 6bb0da8f79b97e1a59b77cb59ba206db1cea9574 Mon Sep 17 00:00:00 2001 From: iratusmachina Date: Sat, 20 Apr 2024 11:25:23 -0400 Subject: [PATCH] Refactoring draft notes generation --- generate_notes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_notes.py b/generate_notes.py index 30c66aa..0a7b8c3 100644 --- a/generate_notes.py +++ b/generate_notes.py @@ -49,8 +49,8 @@ def draft(): # Get the current and previous tags tags = subprocess.check_output(["git", "tag", "--sort=creatordate"], text=True) - if tags: - tags = [tag for tag in tags.split("\n") if tag] + tags = [tag for tag in tags.split("\n") if tag] + if len(tags) > 1: tags.reverse() current_tag, previous_tag, *_ = tags formatted_lines = subprocess.check_output(["git", "log", f"{current_tag}...{previous_tag}", f'--pretty=format:"* %s"'], text=True)