From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Alessio Attilio via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Alessio Attilio <hello@kairosci.dev>,
Alessio Attilio <alessio.attilio@protonmail.com>
Subject: Re: [PATCH v3] hooks: introduce 'hooks.allowNoVerify' configuration
Date: Wed, 2 Sep 2026 22:14:41 +0000 [thread overview]
Message-ID: <apif0QhIHkAAXJmn@fruit.crustytoothpaste.net> (raw)
In-Reply-To: <pull.2215.v3.git.1788369794965.gitgitgadget@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1926 bytes --]
On 2026-09-02 at 17:23:14, Alessio Attilio via GitGitGadget wrote:
> 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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 325 bytes --]
next prev parent reply other threads:[~2026-09-02 22:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 16:17 [PATCH] hooks: introduce 'hooks.allowNoVerify' configuration Alessio Attilio via GitGitGadget
2026-09-02 16:35 ` [PATCH v2] " Alessio Attilio via GitGitGadget
2026-09-02 17:23 ` [PATCH v3] " Alessio Attilio via GitGitGadget
2026-09-02 22:14 ` brian m. carlson [this message]
2026-09-02 17:45 ` [PATCH v4] " Alessio Attilio via GitGitGadget
2026-09-02 19:21 ` [PATCH] " Junio C Hamano
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=apif0QhIHkAAXJmn@fruit.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=alessio.attilio@protonmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=hello@kairosci.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.