Skip to content

fix: only get local coore.hooksPath config#130

Merged
toplenboren merged 2 commits into
toplenboren:masterfrom
cexoso:master
Jul 31, 2025
Merged

fix: only get local coore.hooksPath config#130
toplenboren merged 2 commits into
toplenboren:masterfrom
cexoso:master

Conversation

@cexoso

@cexoso cexoso commented Jul 3, 2025

Copy link
Copy Markdown
Contributor

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

@changeset-bot

changeset-bot Bot commented Jul 3, 2025

Copy link
Copy Markdown

🦋 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

JounQin commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator

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

@cexoso

cexoso commented Jul 3, 2025

Copy link
Copy Markdown
Contributor Author

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.

Comment thread .changeset/cold-falcons-pick.md Outdated
@JounQin JounQin changed the title feat: just get config hooksPath local fix: only get local coore.hooksPath config Jul 3, 2025
@JounQin

JounQin commented Jul 3, 2025

Copy link
Copy Markdown
Collaborator

@cexoso Thanks for your explanation!

@cexoso

cexoso commented Jul 31, 2025

Copy link
Copy Markdown
Contributor Author

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

@JounQin

JounQin commented Jul 31, 2025

Copy link
Copy Markdown
Collaborator

cc @toplenboren

@toplenboren

Copy link
Copy Markdown
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
This was referenced Feb 23, 2026
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