pre-commit: installed git hook should have full path to binary (#77638)
commit1882d20155ba10982e76856c0433de7690a574b4
authorWael Nasreddine <wael.nasreddine@gmail.com>
Sat, 1 Feb 2020 18:05:42 +0000 (1 10:05 -0800)
committerGitHub <noreply@github.com>
Sat, 1 Feb 2020 18:05:42 +0000 (1 10:05 -0800)
treeb540ee2b4d02dffaa762b86b3f7bbd8fa6603be1
parent65e6812dc86d07c4325d2fcb1174a8b50cfd7e58
pre-commit: installed git hook should have full path to binary (#77638)

pre-commit currently install impure Git hooks that look for the
`pre-commit` binary in PATH. If the user has `pre-commit` loaded via a
nix-shell instead of having it installed then GUI editors, such as
Intellij, won't be able to use Git commit because the hook fails trying
to look for the `pre-commit` binary in PATH.

This patch updates the hook template to use the hardcoded path to the
`pre-commit` binary if it was found, fallback to using the one from
PATH.
pkgs/development/python-modules/pre-commit/default.nix
pkgs/development/python-modules/pre-commit/hook-tmpl-use-the-hardcoded-path-to-pre-commit.patch [new file with mode: 0644]