From: Sam Newbold <sam@rwsh.org>
To: git@vger.kernel.org
Subject: core.hooksPath cannot revert to the default locally
Date: Wed, 16 Oct 2024 02:26:13 -0400 [thread overview]
Message-ID: <20241016022613.37813826@scaldcrow> (raw)
From my testing, reading the documentation and hunting through the
source code, it appears that if a system administrator sets the
--system core.hooksPath or a script over which you have limited control
sets the --global core.hooksPath, then there is no way for an
individual repository to configure --local core.hooksPath to get the
default behavior. The naive solution of setting core.hooksPath to be
.git/hooks breaks in the case of worktrees.
I would be happy to code a patch for this if I knew how it should be
configured. Obviously, no local setting for a config variable is meant
to inherit the global or system value. We can go all "set of the null
set" by making the empty string mean "revert to default". We could go
fancy "I know what you really mean" by interpreting ".git/hooks" (or
perhaps any path beginning with ".git") not literally in the case of
worktrees, but as relative to GIT_DIR. Or there could be another
setting set on a local repository to ignore global and system values of
core.hooksPath.
Thank you,
Sam Newbold
next reply other threads:[~2024-10-16 6:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-16 6:26 Sam Newbold [this message]
2024-10-16 9:03 ` core.hooksPath cannot revert to the default locally Phillip Wood
2024-10-16 13:42 ` Phillip Wood
2024-10-16 20:33 ` Taylor Blau
2024-10-17 0:36 ` Sam Newbold
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241016022613.37813826@scaldcrow \
--to=sam@rwsh.org \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).