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

Re: [PATCH v3] hooks: introduce 'hooks.allowNoVerify' configuration

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Sep 2, 2026, 22:14 UTC
Message-ID
<apif0QhIHkAAXJmn@fruit.crustytoothpaste.net>
In-Reply-To
<pull.2215.v3.git.1788369794965.gitgitgadget@gmail.com>
On 2026-09-02 at 17:23:14, Alessio Attilio via GitGitGadget wrote:
Show 12 quoted lines
> From: Alessio Attilio <alessio.attilio@protonmail.com>
> 
> Introduce the 'hooks.allowNoVerify' configuration variable to control
> whether the '--no-verify' (or '-n') command-line option is permitted
> during operations executing client-side hooks (commit, push, merge,
> rebase, am).
> 
> Client-side hooks execute in the user's local repository and cannot serve
> as an authoritative security boundary; authoritative policy enforcement
> belongs on the server (such as via pre-receive hooks). However,
> developers often invoke '--no-verify' out of habit or muscle memory,
> inadvertently skipping local checks.

I agree with Junio that this doesn't seem like a good idea. It's up to the user whether they want to install or use hooks and they are free to disable them or override them as they see fit. If the user doesn't want to use local hooks on an individual case basis, then `--no-verify` is the right option.

In my case, I use hooks for Git LFS when I use that software, but I never use repository owner-provided hooks, although I may use my own. As a result, I almost never use `--no-verify`.

If in your environment you are trying to force developers to use local hooks, the Git FAQ mentions that this is not an effective control and you should stop trying to do that. In fact, I would even argue that you should simply not install hooks by default for repositories using your scripts or build tools because it's up to users whether those are useful for them. The Git FAQ mentions reasons why forced installation of hooks is harmful for many workflows and I don't think we should be hassling users like that.

In any event, it's trivial to simply bypass all hooks by setting `core.hooksPath` to `/dev/null` using a variety of different techniques.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Alessio Attilio via GitGitGadgetNext: Alessio Attilio via GitGitGadget
Message 4 of 6 in “hooks: introduce 'hooks.allowNoVerify' configuration”
  1. hooks: introduce 'hooks.allowNoVerify' configurationAlessio Attilio via GitGitGadget, Sep 2, 2026
  2. hooks: introduce 'hooks.allowNoVerify' configurationAlessio Attilio via GitGitGadget, Sep 2, 2026
  3. hooks: introduce 'hooks.allowNoVerify' configurationAlessio Attilio via GitGitGadget, Sep 2, 2026
  4. brian m. carlsonSep 2, 2026
  5. hooks: introduce 'hooks.allowNoVerify' configurationAlessio Attilio via GitGitGadget, Sep 2, 2026
  6. Junio C HamanoSep 2, 2026

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.