From 6591f7a5e4df5c8a7c49cc010a5bc28370a63290 Mon Sep 17 00:00:00 2001 From: Adrian Vollmer Date: Tue, 23 Jun 2026 15:40:41 +0200 Subject: [PATCH] Fix timestamp retrieval for git commits Signed commits would trip up the parser: ``` File "/home/avollmer/.local/bin/git-backdate", line 89, in get_commit_timestamp return dt.datetime.fromtimestamp(int(timestamp)) ~~~^^^^^^^^^^^ ValueError: invalid literal for int() with base 10: 'gpg: Signature made ``` The flag introduced with this change removes the signatures and the parser works as expected. --- git-backdate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-backdate b/git-backdate index d480b29..0193caa 100755 --- a/git-backdate +++ b/git-backdate @@ -84,7 +84,7 @@ def get_commit_timestamp(commit: str) -> dt.datetime | None: """Return the timestamp of the given commit.""" try: timestamp = ( - check_output(["git", "show", "-s", "--format=%ct", commit]).strip().decode() + check_output(["git", "show", "--no-show-signature", "-s", "--format=%ct", commit]).strip().decode() ) return dt.datetime.fromtimestamp(int(timestamp)) except CalledProcessError: