Open TitanNano opened 6 years ago
In current state every run of hooks requires .githooks
by relative path .git/hooks
-> ../../.githooks
. But in case with worktrees it must be relative path from git root
, that is from root of working copy (WC). It can be got by git rev-parse --show-toplevel
.
It's painful, when npm deps
are different in different WCs – any commit runs with hooks in main WC, where is directory .git
.
Currenty it's simply assumed that there is a .git/hooks directory, but the proper way to do this is to lookup the right path:
This would then also properly support linked worktrees. What should be considered there, is that the hooks might be already installed, since I have to install node modules in every worktree.