From df39abcbc9c2cdb01b7af23d074d795b6519ae6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Weber?= Date: Thu, 18 Jan 2024 21:07:09 +0100 Subject: [PATCH] build: unify git hook output --- .githooks/pre-push.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.githooks/pre-push.py b/.githooks/pre-push.py index b685893149..a63b46f124 100644 --- a/.githooks/pre-push.py +++ b/.githooks/pre-push.py @@ -33,10 +33,10 @@ def main(): local_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD'], universal_newlines=True).strip() wip_prefix = '^#\\d+(?:\\b.*)$' if re.match(wip_prefix, local_branch): - print(f'{time}: The branch {local_branch} can not be pushed as it starts with a "#" which marks it as work in progress', file=open(".githooks/hooks.log", "a")) - print(f'The branch {local_branch} can not be pushed as it starts with a "#" which marks it as work in progress') + print(f'{time}: Branch "{local_branch}" was not pushed because its name starts with a "#" which marks it as work in progress', file=open(".githooks/hooks.log", "a")) + print(f'Branch "{local_branch}" was not pushed because its name starts with a "#" which marks it as work in progress') exit(1) - print(f'{time}: Pushing branch {local_branch}', file=open(".githooks/hooks.log", "a")) + print(f'{time}: Branch "{local_branch}" was pushed', file=open(".githooks/hooks.log", "a")) exit(0) if __name__ == "__main__":