git-commit-message-summary-length

Check the length of a commit message's first line
null

Tech: Bash, Git, VitePress, TypeScript, GitHub

Developed primarily in 2024

Links:

Working on a team that has a rule about how long Git commit messages’ first lines can be? Working with Git tooling that has preferences, like GitHub’s truncating messages longer than 72 characters to 69 characters? Have your own preferences?

There are Git GUIs and IDE plugins that help with that. But what about for people who live on the command line?

git-commit-message-summary-length (an intentionally long name!) to the rescue.

Set a soft character limit (default 50) messages longer than which will trigger a warning, and a hard character limit (default 72) messages longer than which will trigger an error. CLI output highlights the characters over the warning limit in yellow, and characters over the error limit in red. It’s great in a post-commit hook.