Skip to content

fix: only get local coore.hooksPath config #130

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
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

cexoso
Copy link

@cexoso cexoso commented Jul 3, 2025

git config core.hooksPath will get the global config probably,and will overwrite hooks with setHooksFromConfig function,and this will affect the other project。

Copy link

changeset-bot bot commented Jul 3, 2025

🦋 Changeset detected

Latest commit: 945d8b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
simple-git-hooks Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

git config core.hooksPath will get the global config probably,and will overwrite hooks with setHooksFromConfig function,and this will affect the other project。
@JounQin
Copy link
Collaborator

JounQin commented Jul 3, 2025

What do you mean by probably? Any reference? As I linked, the default level is --local when not set.

@cexoso
Copy link
Author

cexoso commented Jul 3, 2025

image
I'm trying to explain.

if you get a key, git will find .git/config firstly, but if .git/config does't have the key. git will find global path secondly, if global has the special key, git will return from global.

you can use --local to tell git, I just get the key from local, if the local config does't has the key, return me empty.

@JounQin JounQin changed the title feat: just get config hooksPath local fix: only get local coore.hooksPath config Jul 3, 2025
@JounQin
Copy link
Collaborator

JounQin commented Jul 3, 2025

@cexoso Thanks for your explanation!

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 this pull request may close these issues.

2 participants