Semantic Git Commit Messages
gist.github.com
gist.github.com
Putting all that aside. I've used the conventional commit format in many of my projects. So far, I've found that without a tool to handle the format for me, I am simply too lazy to sustain that format for more than a few days.
Also, there become situations where your commits contain new code for multiple features that are all related. Or, there are times when I am simply committing code before completing a feature just in case I want to roll something back.
In these cases, there often isn't a good "type" that optimally covers the full scope of what is occurring.
It seems that many of the things we do as programmers are just superfluous ways of "making things easier" or "more organized" that ultimately just waste time and result in unfinished projects.
That tool is Git, it's already built-in. You can create a Git commit template, with the correct format, and then in the comments of the template you list out the semantic options for quick reference.
See `commit.template` here: https://git-scm.com/book/en/v2/Customizing-Git-Git-Configura...
https://gist.github.com/shanecelis/db3f348288be70e4de4e0f249...
Early on in, I used to write “refactor,doc,feature:” before I realized that one of the practices this is meant to encourage is a commit that does one of the things, not all of them. I’m not very strict about it. I always do the semantic title but if I have some documentation mingled with a refactor, oh well.
If you think in terms of semver and changelog autogeneration, these questions have obvious answers. ofc there are also other benefits like improved communication with teammates and contributors (and the curious).
I've never worried about making the wrong choice. I've never spent more than 5 seconds choosing a commit category. It should just be a best-effort system, that adds a bit of Metadata, structure and clarity to commit messages. The many teams I've seen with "wip, wip, wip, fix, fixing class" commit messages in PRs surely isn't aiding code review.
Maybe even what directories/files tend to see `fix` or `refactor` more frequently (signs of a poorly design or "hot" area?)
Also just ran across this, looks interesting: https://github.com/zeke/semantic-pull-requests
(Why are you formatting code by hand anyway? Automated tools exist for that.)
From my experience, backend is the ”small world” where interfaces are known and solutions relatively stable.
Frontend, on the other hand, requires all the same programming skill, but is basically a set of different black boxes that kinda sorta implement the same interfaces in an almost compatible manner, with new ones added regularly and others deprecated, and every 12-36 months a completely new paradigm arrives.
Diffs say what you did. Commits should say why you did.
If this is an excuse to autogenerate your changelog, no thank you.
Anything editable/commentable is better than using immutable commit metadata to author an important part of your documentation.