This patch prevent reinstallation of pre-commit hooks or any script generated
by shebang function to just update the script shebang, since the scripts are
not heavily dependent on a specific Python 3 version:
/usr/bin/env: ‘python3.9’: No such file or directory
Signed-off-by: Luís Ferreira <contact@lsferreira.net>
When git status runs in a repo with submodules, it'll recursively run
git status in every submodule as well by default (sequentially).
git status is substantially slower on Windows than on Linux. git diff
behaves similarly to git status in terms of running recursively within
all submodules. In repos with hundreds of submodules, this quickly adds
up when git status/diff are called multiple times. Pre-commit runs
git status once at the beginning of an operation and then runs git diff
before and after each hook. These calls quickly add up and make
pre-commit unusable in large repos with lots of submodules.
This commit drastically improves performance in repos with lots of
submodules and fixes#1701 by telling git status and git diff to ignore
submodules. This change is not expected to have any negative effect on
existing hooks because each submodule should manage its own hooks
instead of relying on superproject hooks to manipulate their contents.
Add a `--no-allow-missing-config` option to the `init-templatedir`
command. Enable configuration of a Git template that requires newly
cloned repos to have a `pre-commit` config.
If rev is wrapped in single or double quotes (e.g. due to a yamllint quoted-strings rule), when
re-writing the rev to update it, honour the existing quotation style
If using the prepare-commit-msg and commit-msg stages specifically (such
as with the try-repo command), the `--commit-msg-filename` arg must be
provided.
[fixes#1336]
chore: improve error message for hook stage check