Pre commit hook failure
gabrielhdt opened this issue · comments
When I want to commit, I receive the message
.git/hooks/pre-commit: line 13: /nix/store/8n7a65jpm6nbz992jkplv2qi2xhbnp1m-python3.10-pre-commit-2.20.0/bin/pre-commit: No such file or directory
To reproduce
$ touch foo
$ git add foo
$ git commit
Environment
- Void linux, with the nix pkg manager
- Master branch, after 5808c9f
Just to be sure that we reset the whole thing, can you:
$ rm .git/hooks/*
$ rm .pre-commit-config.yaml
$ direnv reload
(or leave and enter nix develop
again if you don't rely on direnv
)
and then try again?
Ah I wasn't in a nix develop
!
It works with nix develop .#ci
at least.
I think it is actually a known problem of cachix/pre-commit-hooks.nix
: it is good at installing hooks, but not so good at uninstalling them, so you end up in inconsistent states if you're not in a world managed by cachix/pre-commit-hooks.nix
. Not sure if there is much we can do about this, though.