This post was never published. Written in January 2017, it was the last draft before a 5-year blogging hiatus. Apparently, bad commit messages were the final straw.
Some of the worst things I see when looking at a repository, internal or open source, are useless commit messages in the vein of:
- Fixed stuff
- Stuff
- whatever
- footer fix
- added stuff
The whole purpose of having a message tied to a commit is for the developer to briefly explain what the committed code changed and preferably "why".
It helps other developers understand what you did
Imagine that you're working in a team with 10 other developers on the same project, you have been assigned to fix a bug that was introduced by a previous commit.
You pull down all the latest changes, create your bugfix branch (if you're using GitFlow) and take a quick peek at the latest changes to see what has changed, and all you see is "Updated stuff"-type comments.
This makes your job frustrating and more time consuming as you would have to wade through all the commits to see what files have changed, instead of quickly reading through the commit log to look for relevant messages regarding the issue at hand.
Now you could use something like git bisect for this, but still.
It helps you in the future
If you're the only one working on a project, writing good commit messages is key to keep track of what you're doing.
The draft ended here. The irony of an unfinished blog post about the importance of clear communication is not lost on me.
