Vim git commit color weirdness
I have been noticing that writing a commit message in git just like I have been doing in svn or CVS gives me a rather colorful output (see the credited link below for a screen grab).
Searching on the web led me to this post about someone else who found it odd and actually posted about it.
Turns out that the vim syntax file is trying to point out git commit messages best practices.
To summarize these:
- Git commit messages are written as in a mail, because they can actually be sent as an email.
- Keep text wrapped at 72 chars, like in most plain text email.
- Use the first line like the subject of an email - a summary of your changes. Should be 50 characters or less. Anything longer is fine too, just that it can get truncated in git log summaries.
- Leave the second line blank
- Put the details from third line onwards. Think of this as the body of the message.
- Write commit messages in present tense. Well, vim syntax doesn’t check this 😄 but I am just noting this here because I generally tend NOt to do this.