Skip to content
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

Git hook core.hooksPath #613

Closed
phyzical opened this issue Nov 15, 2019 · 7 comments · Fixed by #744
Closed

Git hook core.hooksPath #613

phyzical opened this issue Nov 15, 2019 · 7 comments · Fixed by #744

Comments

@phyzical
Copy link

Hey there love the tool,

i apply my hooks via my .gitconfig via "core.hooksPath" instead of per repository .git folder.

is there anyway of having gitup use the global .gitconfig to gain access to my common hooks?

to avoid having to boostrap every repo

thanks!

@weareoutman
Copy link

weareoutman commented Feb 9, 2021

Hi, love the tool too.

It seems that a popular hooks manager husky starts to use core.hooksPath since v5. And there will be no hooks triggered when we do commit from GitUp, if we configure hooks by that tool.

It would be nice if GitUp follow this config, otherwise users have to choose between these two tools, :(.

FYI, there is the official documentation about core.hooksPath.

lucasderraugh pushed a commit that referenced this issue Mar 22, 2021
When core.hooksPath is set, use it as hooks path.

Resolves #613.
@phyzical
Copy link
Author

@lucasderraugh sorry to beat a dead horse but based on the change log of the latest release this should now be out correct? problem is i dont see it having any effect/ i cant seem to find an option to enable?

im happy to raise a new issue, but figured i would double check there isnt a magic flag to get it rolling

image
image

@maku693
Copy link
Contributor

maku693 commented Feb 22, 2022

Which commit hook are you intend to trigger? I think GitUp doesn't support all hooks currently. (I suppose they are pre-commit, commit-msg, post-commit, and pre-push).

cf.) https://github.com/git-up/GitUp/search?q=runHookWithName

@phyzical
Copy link
Author

@maku693 pre-commit, commit-msg is what im after.

ah opps... i thought i had added them to my repo root turns out i had them in a ~/.githooks folder i assume ive setup a config to point here instead.. ill have another play tomorrow

sorry >< ill post again with the outcome i end up with to help anyone else :)

thanks for the reply @maku693 :)

@lucasderraugh
Copy link
Collaborator

Thanks @maku693!

@phyzical
Copy link
Author

sorry just to confirm say i have git config core.hooksPath returning hooksPath = /Users/phyzical/.githooks should gitup comply to this? or is it just going straight to the .git/hooks folder of the current repository. i cant seem to get it to use neither my config set folder OR the repo root one.

Are there any like logs i could look over to see this? (via terminal git commit uses the ~/.githooks fine so i dont think its the hooks themselves right?)

@phyzical
Copy link
Author

phyzical commented Mar 3, 2022

oh and now it works... maybe we need to restart the whole gitup client to detect changes or something o.0
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

4 participants