Skip to content
Michael Currin edited this page May 12, 2021 · 3 revisions

I am solving for the case where the why of a commit is immaterial or self-evident. For example when I am making doc changes - I am happy to lose the nuance of whether I fixed a link or added an empty line or changed a heading level or whatever, because it's not code. Or it's a change made to follow a style. Or renaming a file because I like the new name better.

Why

Automate creation of git commit messages

Why? Because I am tired of friction (mental effort and keystrokes) from writing commit messages for trivial changes or when an algorithm could easily write what I wrote.

This follows the 80-20 rules - 80% of commits can generated programmatically and the other 20% need attention to write.

And yes I am lazy because I want to automate part of my task to be more efficient - but that's also what got me into programming and makes a good programmer. I read that someone who accepts doing things the long way and doesn't improve or automate the process is not a good candidate.

Disclaimer: If the change you are making is non-trivial, please do write a detailed message about it and then go back to auto generated message. There are principles to writing a good commit message around covering why

Why 2

Because sometimes a change is so low impact the commit message is longer than the number of characters changed so there is friction.

This means that commits become generic. Rather than "Added missing comma to foo.txt" it becomes "Added comma to foo.txt", "Updated foo.txt" or "fix: foo.txt" or "fix", or even avoiding a commit at all and waiting until there are more changes to commit on the same or other file. This can good sometimes, but generally the idea is for atomic commits - frequent, small commits that each do one thing. I find myself editing on GitHub using the generate message often

When you're tired and making frequent commits and getting far in a project, the human tendency is to write messages which are not informative. Like the example here

https://chris.beams.io/posts/git-commit/

But, an algorithm will always be wide awake

Clone this wiki locally