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

fix(init): resolve hooks path relative to repo root #1446

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ethanwu10
Copy link

@ethanwu10 ethanwu10 commented Nov 15, 2024

Ensure that core.hooksPath is resolved relative to the repository root of the main worktree, or the git dir if it is bare (git itself uses the same logic for bare repos).

Fixes #1438

@ethanwu10
Copy link
Author

I'm not clear on which worktree core.hooksPath is being read from and where it's supposed to be resolved relative to. If I'm reading the git docs correctly, they should be read from the current worktree regardless of which worktree the config value itself was read from. I'll need to figure out how to test this properly.

Ensure that `core.hooksPath` is resolved relative to the repository root
of the current worktree, or the git dir if it is bare. This should be
the same logic as git uses for resolution.
@arxanas
Copy link
Owner

arxanas commented Nov 19, 2024

I'm not clear on which worktree core.hooksPath is being read from and where it's supposed to be resolved relative to. If I'm reading the git docs correctly, they should be read from the current worktree regardless of which worktree the config value itself was read from. I'll need to figure out how to test this properly.

I agree with that interpretation of the docs: a relative hook path always needs to be interpreted from the worktree root that the hook is running in (which means that there's not a way to specify a hook path that's relative to the main worktree).

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.

core.hooksPath not resolved from repository root
2 participants