Describe the bug
When using devenv activate (also direnv) if you have pre-commit hooks and check out an older (or newer) version of your devenv.lock the pre-commit fingerprint on the installed hook will change, which causes the pre-commit hooks to fail until repaired.
To reproduce
- Turn on auto-activation (through devenv or direnv) on a repo with pre-commit hooks.
- Check out an older branch/commit
- Auto-activate will attempt to update the pre-commit hooks but will not error
- Attempt to commit a file that needs to be evaluated by the hook
- Error message:
bug: pre-commit's script is installed in migration mode
run `pre-commit install -f --hook-type pre-commit` to fix this.
Create gist here: https://gist.github.com/
Make sure to include full logs and what you expected to happen.
-->
Workaround
Run the command it tells you to:
nix-shell -p pre-commit --run 'pre-commit install -f --hook-type pre-commit'
You can resume committing (most of the time, sometimes it requires you to delete a file in the .git/hooks folder. It outputs what to do in this case, but I haven't figured out how to reproduce this to get the exact error message again. Something like "cowardly refusing to do....")
Version
devenv 2.1.0 (aarch64-darwin)
Describe the bug
When using
devenv activate(also direnv) if you have pre-commit hooks and check out an older (or newer) version of your devenv.lock the pre-commit fingerprint on the installed hook will change, which causes the pre-commit hooks to fail until repaired.To reproduce
Create gist here: https://gist.github.com/
Make sure to include full logs and what you expected to happen.
-->
Workaround
Run the command it tells you to:
nix-shell -p pre-commit --run 'pre-commit install -f --hook-type pre-commit'You can resume committing (most of the time, sometimes it requires you to delete a file in the .git/hooks folder. It outputs what to do in this case, but I haven't figured out how to reproduce this to get the exact error message again. Something like "cowardly refusing to do....")
Version
devenv 2.1.0 (aarch64-darwin)