Writing good commit messages
chiark.greenend.org.uk
chiark.greenend.org.uk
Commit messages can be good for providing context as to why something is changing, but all context as to how it works should be formalized elsewhere. For example, a commit message that tells you how something works could immediately become misleading when functionality is changed in the future. And you’d have to consume the whole chain of commits to begin to understand that.
Personally, I overdocument everything with verbose comments in code that explain things in detail, as well as the context, thought processes, and assumptions behind it. I have found that it creates a codebase you can read more like a book, which makes it so much easier to build context. I haven’t measured it exactly, but if I had a 1000 LoC file, I’d say 600+ lines would be comments.
This gets omitted sufficiently often that I have largely given up on requiring it except for noteworthy code changes that I am a reviewer for. It's a very hard thing to get consistent adherence to in my experience. I highly recommend others in a similar boat to at least lead by example and annotate your code changes consistently so you can at least identify relevant changes that you wrote. Getting everybody else to is another story...
I only use squash and merge now, no more reverting reverts, no more merge commits. So the PR or MR title is the commit message, which means writing good PR / MR titles.
> Therefore, write your message so that it’s still readable in that form.
Therefore you should use better tools and push for improvements in the standard instead of wasting time worrying about such text luxuries as line wrapping
The thing is, one-way improvement is possible by using better tools, but if you force wrapping with newlines than good tools won't be able to fix it
How many times a year do you really run a bisect? I run it like twice or thrice tops.