DEV Community

Discussion on: How To Enforce Conventional Commit Messages Using GIT Hooks

Collapse
 
arunschirps profile image
Arun

Good post, thank you!

I do have a question. As what you covered here uses a file that is truly at local working folder, how can we ensure that the local commit hook code is not tampered by the developer to permit his commit?

In a CVS, the hook is handled at the server, I guess, so, I believe a CVS fares better in those cases.

Collapse
 
prahladyeri profile image
Prahlad Yeri

You can never do such validation on git because git is a decentralized system (unlike CVS). All you can do is a best effort automation and scripting for this (like this package) but ultimately its the user's machine, you can't prevent them from altering their hooks folder.