{"thread":{"id":"52054","subject":"Commits with --no-verify option","startedAt":"2019-10-17T08:58:56Z","lastAt":"2019-10-18T00:19:42Z","messageCount":2,"participants":["Manoj Sterex","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"384250","messageId":"CAJoS+LqqeD3zLYi=jnxc9A=bLT_bpTrjP1bZMPX4NMehd2V3cQ@mail.gmail.com","threadId":"52054","inReplyTo":null,"subject":"Commits with --no-verify option","fromName":"Manoj Sterex","fromEmail":"*@sterex.in","sentAt":"2019-10-17T08:56:34Z","receivedAt":"2019-10-17T08:58:56Z","isPatch":false,"sender":{"key":"*@sterex.in","avatar":null},"body":"Hi all,\n\nCurrently, AFAIK, there is no way to know if a commit was done with or\nwithout using the '--no-verify' option. That is, git does not track if\nhooks were skipped when the commit happened.\n\nIs there some way to track this in the log?\n\nRegards,\nManoj\n"},{"id":"384326","messageId":"20191018001934.cq2bqcron32ql2ux@camp.crustytoothpaste.net","threadId":"52054","inReplyTo":"CAJoS+LqqeD3zLYi=jnxc9A=bLT_bpTrjP1bZMPX4NMehd2V3cQ@mail.gmail.com","subject":"Re: Commits with --no-verify option","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2019-10-18T00:19:35Z","receivedAt":"2019-10-18T00:19:42Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2019-10-17 at 08:56:34, Manoj Sterex wrote:\n> Hi all,\n> \n> Currently, AFAIK, there is no way to know if a commit was done with or\n> without using the '--no-verify' option. That is, git does not track if\n> hooks were skipped when the commit happened.\n> \n> Is there some way to track this in the log?\n\nNo, there isn't, and even if there were, it would be trivial to bypass\n(such as by using git commit-tree, which does not run hooks).\n\nYou haven't elaborated on why you want this, but typically the reason\npeople ask for this is that they do some sort of data checking (testing\nor linting) in the pre-commit hook.  Since that code runs on the\nauthor's system and is trivially bypassed (by simply deleting the hook),\nit isn't a good way to enforce policy; usually that should be done in a\ntest or CI infrastructure.\n\nIn addition, it's common for advanced users to make a series of\ntemporary commits to save state and then squash them later.  It wouldn't\nbe reasonable for a pre-commit hook to enforce certain policies, such as\na commit message syntax policy, in such a case, so --no-verify exists\nfor users who know what they're doing and would like to bypass standard\nchecking.\n-- \nbrian m. carlson: Houston, Texas, US\nOpenPGP: https://keybase.io/bk2204\n"}]}