Commit messages

Working on the DueDil codebase was my first encounter with a “legacy” application. Consulting and startup land has shielded me from this experience. When maintaining and improving such applications you get an appreciation for commit messages. It can be a saving grace when inspecting the git log reveals a fleshed out train of thought for why the code you’re looking at was modified the way it was. I’ve been saved enough times that I’ve started paying forward my dues over the last 2 years. One recent addition has been getting more systematic about how I style my commit messages.

I’ve adopted the AngularJS convention for prefixing commit messages with feat, fix, docs, style, refactor, perf, test or chore. It’s a small thing, but it’s great when reviewing a bunch of commits.

feat: A new feature
fix: A bug fix
docs: Documentation only changes
style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactor: A code change that neither fixes a bug nor adds a feature
perf: A code change that improves performance
test: Adding missing or correcting existing tests
chore: Changes to the build process or auxiliary tools and libraries such as documentation generation

For a comprehensive read on writing better commit messages, I suggest this piece.