question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use commit-msg hook to validate commit message

See original GitHub issue

While 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:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Undistractioncommented, Feb 19, 2018

prepush is kinda late, you’d have to rebase -i to fix, commit-msg lets you know as soon as you screw up.

This is exactly why I like running things before commit. Less hassles fixing bad commits (or adding new distracting one for fixes).

1reaction
guillaumearmcommented, Feb 19, 2018

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found