Use commit-msg hook to validate commit message
See original GitHub issueWhile we’re thinking about automating some stuff using git hooks, an idea:
Use commit-msg
hook to validate commit message according to Commit Message Guidelines. and drop the link if validation fails, and perhaps explain the problem.
Even validating just the first line would be helpful, as “typing” and “scoping” commits is not the standard practice.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Get commit message in Git hook - Stack Overflow
commit -msg This hook is invoked by git commit, and can be bypassed with the --no-verify option. It takes a single parameter, the...
Read more >Git commit-msg hook to validate for jira issue or the word merge
It auto inserts into the message Jira issues found in branch's name but not in the content otherwise behaves like yours. For example...
Read more >A Git-Hook for Commit Messages Validation - No Husky, Just JS
Have a git message hook which will check if the commit message is a valid conventional commit message; Have this git message hook...
Read more >commit-msg Hook - gerrit-review
commit -msg - Edit commit messages to insert a Change-Id tag. ... When present, Gerrit uses this tag to track commits across cherry-picks...
Read more >Enforcing Git Commit Message Style | by Austin Cunningham
Remove the .sample and the hook script becomes live in this case I used the commit-msg git hook and use it to run...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is exactly why I like running things before commit. Less hassles fixing bad commits (or adding new distracting one for fixes).
There is commitlint, I test it on a personal project coupled with lint-staged but I removed both because I hate waiting when I commit. CI are here for doing that kinds of stuffs.