nikhil.io

On Good Commit Messages

On the developer side, what I hope people are doing is trying to make, not just good code, but these days we’ve been very good about having explanations for the code. So commit messages to me are almost as important as the code change itself. Sometimes the code change is so obvious that no message is really required, but that is very very rare. And so one of the things I hope developers are thinking about, the people who are actually writing code, is not just the code itself, but explaining why the code does something, and why some change was needed. Because that then in turn helps the managerial side of the equation, where if you can explain your code to me, I will trust the code.

A lot of open source in general is about communication. And part of it is the commit messages, part of it is just the email going back and forth. Communicating what you’re trying to do or communicating why something doesn’t work for you is really important.

– Linus Torvalds, in conversation with Dirk Hohndel (emphasis mine)

This is pretty much what mine look like. For my personal stuff, I get so lazy, I use a list of developer excuses to generate a commit log that looks like this 🤦‍♀️

My shitty, lazy commit log

I hereby swear to read this document and make writing good commit messages a habit ✋🚀