tweag / monad-bayes

A library for probabilistic programming in Haskell.
MIT License
407 stars 62 forks source link

nix develop silently adds .git/hooks/pre-commit #252

Closed turion closed 1 year ago

turion commented 1 year ago

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 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.

turion commented 1 year ago

I tried again and cannot reproduce. Will reopen when it occurs again.