git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: core.hooksPath cannot revert to the default locally

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
Oct 16, 2024, 09:03 UTC
Message-ID
<dea863c3-7b54-4f8d-b6b0-6087b4cb1abe@gmail.com>
In-Reply-To
<20241016022613.37813826@scaldcrow>
Hi Sam
On 16/10/2024 07:26, Sam Newbold wrote:
Show 7 quoted lines
>  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'm pretty sure I've used "git -c core.hookspath=/dev/null ..." in the past when I've wanted to temporarily disable my hooks path, I can't find anything in the documentation though. If

     git config core.hookspath /dev/null
does work for you it would be really helpful to update the documentation.
Best Wishes
Phillip
Show 13 quoted lines
> 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
> 
Previous: Sam NewboldNext: Phillip Wood
Message 2 of 5 in “core.hooksPath cannot revert to the default locally”
  1. Sam NewboldOct 16, 2024
  2. Phillip WoodOct 16, 2024
  3. Phillip WoodOct 16, 2024
  4. Taylor BlauOct 16, 2024
  5. Sam NewboldOct 17, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.