Skip to content

Conversation

cexoso
Copy link
Contributor

@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
Contributor 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!

@cexoso
Copy link
Contributor Author

cexoso commented Jul 31, 2025

This PR hasn't been merged. The problem still exists. Is there something I need to do?

@JounQin
Copy link
Collaborator

JounQin commented Jul 31, 2025

cc @toplenboren

@toplenboren
Copy link
Owner

Looks good to me, thanks for the fix @cexoso and thanks for your review @JounQin

Merging the code now and preparing the release 🚀

@toplenboren toplenboren merged commit 1abdcd7 into toplenboren:master Jul 31, 2025
4 checks passed
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.

3 participants