git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Commits with --no-verify option
@ 2019-10-17  8:56 Manoj Sterex
  2019-10-18  0:19 ` brian m. carlson
  0 siblings, 1 reply; 2+ messages in thread
From: Manoj Sterex @ 2019-10-17  8:56 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Commits with --no-verify option
  2019-10-17  8:56 Commits with --no-verify option Manoj Sterex
@ 2019-10-18  0:19 ` brian m. carlson
  0 siblings, 0 replies; 2+ messages in thread
From: brian m. carlson @ 2019-10-18  0:19 UTC (permalink / raw)
  To: Manoj Sterex; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 1283 bytes --]

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 868 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-18  0:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17  8:56 Commits with --no-verify option Manoj Sterex
2019-10-18  0:19 ` brian m. carlson

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).