There’s a community standard out there called Conventional Commit for structured git-commit messages. If you don’t know about it already, it recommends a strict type(scope?): description format for describing a code change in a repo.
The bigger problem by far in my experience is getting devs to write more than ‘fixed bugs’ or other meaningless drivel. Trying to get them to conform to any standard like this would be impossible unless enforced by some commit hook (dear god no!).
Even this new ‘standard’ shows the commit body as [optional]. The first line in a git commit is supposed to be a short summary, not the entire message. I try to write whole sentences, paragraphs and bullet lists in anything that isn’t trivial.
My last job enforced a Jira ticket number looking thing, but didn’t actually check that it was a valid ticket. The number of times I would read a commit message with zero content, then go to jira to find some reference and either find the wrong ticket, or perhaps the right ticket, but still no description, … too damn high!
Idea being that you front load the important stuff, so if you only read e.g. the first 5 lines, you don’t miss anything important later on, you can only “refine” the information you’ve already received.
Oddly enough the folks I work with are really good at the Jira ticket thing and frankly it’s much more useful than “feat” prefixes on everything. Because the Jira ticket gives me a “why” which can be amazingly helpful when trying to figure out “why was this line added”.
I have never once found feat/fix/chore to be of any use when looking at history. It’s useless noise.
I’m OK with Jira ticket for branch names and pull requests. If something needs paragraphs to explain it, it should be a ticket. By all means copy that to the pull request and then have it in the merge (or squash commit).
If fact, I think I’ll suggest we automate that in my org - we’ve lived through a TFS to Jira migrations and it’s a lot harder to track down the original info now. If you migrate from GitHub to GitLab or ForgeJo, that’s one more layer of business knowledge and motivation that gets lost.
Either way, I’m on board with a simple “Fixed API routing” or “Improved Artist card reflow” message. If I’m reading it, I’m already looking at the routes or the CSS.
One thing I’ve found useful with some git forges (haven’t tried them all so no idea if it’s universal) is tagging commits to issues and/or prs. Never bothered with the auto close functionality but assuming people actually put details into tickets, it’s come in handy a bunch of times this year to figure out why something got implemented when the original contributor is long gone.
The bigger problem by far in my experience is getting devs to write more than ‘fixed bugs’ or other meaningless drivel. Trying to get them to conform to any standard like this would be impossible unless enforced by some commit hook (dear god no!).
Even this new ‘standard’ shows the commit body as [optional]. The first line in a git commit is supposed to be a short summary, not the entire message. I try to write whole sentences, paragraphs and bullet lists in anything that isn’t trivial.
My last job enforced a Jira ticket number looking thing, but didn’t actually check that it was a valid ticket. The number of times I would read a commit message with zero content, then go to jira to find some reference and either find the wrong ticket, or perhaps the right ticket, but still no description, … too damn high!
If devs on the team have trouble writing good commit messages, forcing input won’t really help
IMO would be better off auto-pulling names of components that were touched into the message.
I’ve seen people suggest using the inverted pyramid method style that journalists use.
https://en.wikipedia.org/wiki/Inverted_pyramid_(journalism)
Idea being that you front load the important stuff, so if you only read e.g. the first 5 lines, you don’t miss anything important later on, you can only “refine” the information you’ve already received.
Oddly enough the folks I work with are really good at the Jira ticket thing and frankly it’s much more useful than “feat” prefixes on everything. Because the Jira ticket gives me a “why” which can be amazingly helpful when trying to figure out “why was this line added”.
I have never once found feat/fix/chore to be of any use when looking at history. It’s useless noise.
I’m OK with Jira ticket for branch names and pull requests. If something needs paragraphs to explain it, it should be a ticket. By all means copy that to the pull request and then have it in the merge (or squash commit).
If fact, I think I’ll suggest we automate that in my org - we’ve lived through a TFS to Jira migrations and it’s a lot harder to track down the original info now. If you migrate from GitHub to GitLab or ForgeJo, that’s one more layer of business knowledge and motivation that gets lost.
Either way, I’m on board with a simple “Fixed API routing” or “Improved Artist card reflow” message. If I’m reading it, I’m already looking at the routes or the CSS.
One thing I’ve found useful with some git forges (haven’t tried them all so no idea if it’s universal) is tagging commits to issues and/or prs. Never bothered with the auto close functionality but assuming people actually put details into tickets, it’s come in handy a bunch of times this year to figure out why something got implemented when the original contributor is long gone.