Skip to content

Honor hooksPath setting in local .git/config #2271

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

Open
svoop opened this issue Jan 7, 2025 · 0 comments
Open

Honor hooksPath setting in local .git/config #2271

svoop opened this issue Jan 7, 2025 · 0 comments

Comments

@svoop
Copy link

svoop commented Jan 7, 2025

The prepare-commit-msg script is only taken into account if it is located in the default location .git/hooks/

However, a common pattern for projects to enforce commit message consistency is to commit a hooks directory such as lib/git/hooks to the project repo and then include the following somewhere in the clone instructions, a Rake task or similar:

git config core.hooksPath lib/git/hooks

This setting is apparently ignored by fork.

How about a quick git config get core.hooksPath instead of hardcoding the default path?

(This is somewhat related to #1749 and maybe #1789 in the sense that Fork should ideally use hook scripts the same way as the git CLI does to prevent surprising behavior.)

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

No branches or pull requests

1 participant