# Commits with --no-verify option

2 messages from 2019-10-17 to 2019-10-18. Participants: Manoj Sterex, brian m. carlson.
Thread: https://gitlist.dev/t/52054

## Manoj Sterex, 2019-10-17 08:56

Subject: Commits with --no-verify option
Message-ID: <CAJoS+LqqeD3zLYi=jnxc9A=bLT_bpTrjP1bZMPX4NMehd2V3cQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAJoS%2BLqqeD3zLYi%3Djnxc9A%3DbLT_bpTrjP1bZMPX4NMehd2V3cQ%40mail.gmail.com

```
Hi all,

Currently, AFAIK, there is no way to know if a commit was done with or
without using the '--no-verify' option. That is, git does not track if
hooks were skipped when the commit happened.

Is there some way to track this in the log?

Regards,
Manoj

```

## brian m. carlson, 2019-10-18 00:19

Subject: Re: Commits with --no-verify option
Message-ID: <20191018001934.cq2bqcron32ql2ux@camp.crustytoothpaste.net>
URL: https://gitlist.dev/e/20191018001934.cq2bqcron32ql2ux%40camp.crustytoothpaste.net
In-Reply-To: <CAJoS+LqqeD3zLYi=jnxc9A=bLT_bpTrjP1bZMPX4NMehd2V3cQ@mail.gmail.com>

```
On 2019-10-17 at 08:56:34, Manoj Sterex wrote:
> Hi all,
> 
> Currently, AFAIK, there is no way to know if a commit was done with or
> without using the '--no-verify' option. That is, git does not track if
> hooks were skipped when the commit happened.
> 
> Is there some way to track this in the log?

No, there isn't, and even if there were, it would be trivial to bypass
(such as by using git commit-tree, which does not run hooks).

You haven't elaborated on why you want this, but typically the reason
people ask for this is that they do some sort of data checking (testing
or linting) in the pre-commit hook.  Since that code runs on the
author's system and is trivially bypassed (by simply deleting the hook),
it isn't a good way to enforce policy; usually that should be done in a
test or CI infrastructure.

In addition, it's common for advanced users to make a series of
temporary commits to save state and then squash them later.  It wouldn't
be reasonable for a pre-commit hook to enforce certain policies, such as
a commit message syntax policy, in such a case, so --no-verify exists
for users who know what they're doing and would like to bypass standard
checking.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

```
