by lexicality · 2y ago · 0 comments
It's very hard to rank them, but very high on my list of things that make me want to send people actionable threats is when I'm searching down the history of a bug to figure out if it was a deliberate change that had unexpected consequences or just a mistake is when the git blame path ends on a commit like this.
I don't care how minor you think your change is, if you're working on something collaboratively you need to express intent in your commit messages!
100%! And if somebody cannot communicate the intent, there is a high chance they don't understand fully what they just did.
This has got to be the author fishing for reactions, right? My reaction, were I on his team, would be to revoke commit privileges.
If I'm working on something "by myself", I'm really collaborating with my future selves, who will appreciate the information that I'll forget after the next context switch.
Elaborate commit messages are great, and most people write commit messages that could be more elaborate.
But most people also tend to squash several changes together, because it's easier.
Being overzealous about writing elaborate commit messages for minor cookies is IMHO probably counter productive.
If the commit message is "fix indentation" then I will ignore it and skip over it while searching the commit history. If it's "minor" or "fix" then I have to open the commit and look to see what it actually is.
These "minor cookies" add up rapidly.
(side note, people that squash important changes together are also on The List)
It’s as if a thousand commits cried out in anguish and were suddenly silenced.
Is the change _just_ changing indentation or is it changing something else which is hidden by a bunch of indentation changes?
The difference between a commit message like "reindent" and "." is that the former makes it clear that the change is intended to be completely superficial and (unless you're writing python) should have no impact on anything.
Now the person who wrote that commit message may be lying, or may have made a mistake, but, with even a commit message such as "reindent", it's much easier/faster to approach the issue if your bisect lands on such a commit message as you can go straight for "well let's normalize both versions to see if there's an accidental change hidden in here" rather than getting frustrated trying to figure out what the commit was about.
> But most people also tend to squash several changes together, because it's easier.
Don't.
I also disagree with the author of the article about having an unclean history, it's not that hard to keep a clean history and, combined with actually properly splitting and isolating changes, makes it much easier to review the code. Proper use of git isn't solely centred around making bisect work.