From 0393dc39bf450cf20df9db63bac135c078f64a14 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Mar 28 2023 06:53:30 +0000 Subject: Add more information about pre-push hook It's not obvious to many users where the check is coming from, and they have the power to edit the script or delete it completely. Let's try to improve that a bit. Signed-off-by: Lubomír Sedlář --- diff --git a/pyrpkg/__init__.py b/pyrpkg/__init__.py index e8f4886..7a3c9c6 100644 --- a/pyrpkg/__init__.py +++ b/pyrpkg/__init__.py @@ -1806,6 +1806,10 @@ class Commands(object): hook_content = textwrap.dedent(""" #!/bin/bash + # This file was generated by {0} when cloning the repository. + # You can edit it to your liking or delete completely. It will not + # be recreated. + _remote="$1" _url="$2" @@ -4429,7 +4433,7 @@ class Commands(object): return self._repo_name, version, release def pre_push_check(self, ref): - show_hint = ('Hint: this check (pre-push hook script) can be bypassed by adding ' + show_hint = ('Hint: this check (.git/hooks/pre-push script) can be bypassed by adding ' 'the argument \'--no-verify\' argument to the push command.') try: commit = self.repo.commit(ref)