Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properly lookup git hooks directory #48

Open
TitanNano opened this issue Sep 7, 2017 · 1 comment · May be fixed by #57
Open

Properly lookup git hooks directory #48

TitanNano opened this issue Sep 7, 2017 · 1 comment · May be fixed by #57

Comments

@TitanNano
Copy link

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:

 git rev-parse --git-path hooks

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.

@xoxulin
Copy link

xoxulin commented Oct 31, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants