I also hit this problem, and I'm definitely not convinced by the author's answer in #1198. Requiring to edit a personal file/setting to be able to use a software does not seems acceptable to be me.
Anyway, the workaround I found is to prevent pre-commit
to use global config during install phase, where you probably have setup your core.hookspath
. As there is no option, we can trick git by telling it to use /dev/null
as global config dir, only during install time:
$ XDG_CONFIG_HOME=/dev/null pre-commit install
pre-commit installed at .git/hooks/pre-commit
I'm not sure to fully understand the implication of doing so, but I'm aware that my global git hooks won't run anymore when pre-commit
is enabled on a project :)