It seems that nix develop adds a file .git/hooks/pre-commit without asking. This hook then seems to try, whenever committing, to launch an executable, unhelpfully called pre-commit as well. This then fails whenever trying to commit in an environment without that executable (e.g. outside nix develop), with a hard to understand error message.
There is a message nix-pre-commit-hooks: hooks up to date, but it's easy to overlook or misunderstand. And anyways one cannot opt out.
To Reproduce
nix develop
ls .git/hooks
Expected behavior
nix develop shouldn't silently mess with my .git folder. This should either be a loud warning, or an extra opt-in step.
Describe the bug
It seems that
nix develop
adds a file.git/hooks/pre-commit
without asking. This hook then seems to try, whenever committing, to launch an executable, unhelpfully calledpre-commit
as well. This then fails whenever trying to commit in an environment without that executable (e.g. outsidenix develop
), with a hard to understand error message.There is a message
nix-pre-commit-hooks: hooks up to date
, but it's easy to overlook or misunderstand. And anyways one cannot opt out.To Reproduce
Expected behavior
nix develop
shouldn't silently mess with my.git
folder. This should either be a loud warning, or an extra opt-in step.