Disclaimer: yes, I've read Skip Git commit hooks and I know about the -n
flag, but this is not what I'm looking for.
I have that pre-commit hook that runs in order to do some code prettifying (replace tabs with spaces, remove double empty lines, ...).
However, there are some use cases where I don't want the hook to run: for example, when I'm checking in some Makefiles, I cannot simply replace tabs with spaces, so I'd have to skip these files.
If I were the only developer, I would be fine with the -n
flag in order to prevent the hook from being run, but there are other guys that use UIs that don't know the -n
flag (cough tortoisegit) and they won't be willing to specify some flags to commit
.
Apart of implementing the skipping directly in the hook and the obvious -n
way: are there any other ways how I could prevent the pre-commit hook to be run?