From dfaca5b4c1088ca8096b169737c869f0c4383d86 Mon Sep 17 00:00:00 2001 From: Justin Lecher Date: Sat, 7 Dec 2024 13:01:47 +0000 Subject: [PATCH] fix: #1281 pre-commit fails with log.showsignature=True Fixes https://github.com/mwouts/jupytext/issues/1281 by skipping the signature in the log output --- src/jupytext/cli.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/jupytext/cli.py b/src/jupytext/cli.py index f270b3fc..27c36564 100644 --- a/src/jupytext/cli.py +++ b/src/jupytext/cli.py @@ -837,9 +837,11 @@ def lazy_write(path, fmt=None, action=None, update_timestamp_only=False): else: message = "[jupytext] Writing {path}{format}{action}".format( path=shlex.quote(path), - format=" in format " + short_form_one_format(fmt) - if fmt and "format_name" in fmt - else "", + format=( + " in format " + short_form_one_format(fmt) + if fmt and "format_name" in fmt + else "" + ), action=action, ) if diff is not None: @@ -1057,7 +1059,9 @@ def git_timestamp(path): # Return the commit timestamp try: - git_ts_str = system("git", "log", "-1", "--pretty=%ct", path).strip() + git_ts_str = system( + "git", "log", "-1", "--pretty=%ct", "--no-show-signature", path + ).strip() except SystemExit as err: if err.code == 128: # git not initialized