rycus86 / githooks

Githooks: per-repo and global Git hooks with version control
MIT License
382 stars 20 forks source link

Break recursion occuring with shared repos #50

Closed gabyx closed 4 years ago

gabyx commented 5 years ago

We need to consider the following When you git hooks shared update in a local repo and it downloads the repo into ~/.githooks/shared/hookrepo During any git pull which happens in this shared hook checkout folder, since it contains an .githooks folder and .git/hooks is setup with the githook manager: any post-merge hook will be executed since it reacts to git pull.

To break this recursion, we should skip executing any hook. Solution:

rycus86 commented 5 years ago

https://github.com/typicode/husky/issues/206#issuecomment-471169193

Maybe that's a cheaper option to implement -- git -c core.hooksPath=/dev/null pull

gabyx commented 4 years ago

Fixed with env -i. I close this.