From 49b52f4c97bc2a1b183e639a9e47e5e86db30a45 Mon Sep 17 00:00:00 2001 From: Thomas Aglassinger Date: Fri, 7 Jan 2022 03:45:07 +0100 Subject: [PATCH] Fix misleading error message The command given in the previous error message only changed the local script to executable. When running pre-commit the next time, it failed again with the same error message. The new command actually changes the script in the repository to be executable, and pre-commit runs through the next time. See also: . --- pre_commit_hooks/check_shebang_scripts_are_executable.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre_commit_hooks/check_shebang_scripts_are_executable.py b/pre_commit_hooks/check_shebang_scripts_are_executable.py index 50bc9c0..9224bb3 100644 --- a/pre_commit_hooks/check_shebang_scripts_are_executable.py +++ b/pre_commit_hooks/check_shebang_scripts_are_executable.py @@ -34,7 +34,7 @@ def _message(path: str) -> None: print( f'{path}: has a shebang but is not marked executable!\n' f' If it is supposed to be executable, try: ' - f'`chmod +x {shlex.quote(path)}`\n' + f'`git update-index --chmod=+x {shlex.quote(path)}`\n' f' If it not supposed to be executable, double-check its shebang ' f'is wanted.\n', file=sys.stderr,