'How to identify if a git commit skipped pre-hook checks or not?

We have set of predefined pre-hooks which checks for code validation and runs commit message enforcers and some-other things, but people tend to skip this validations by running git commit -n.

Is there way to identify those commits which skipped pre-hooks ? Or can we add some metadata to each commit with pre-hooks passed or pre-hooks failed ?

Thanks,



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source