JP Camara @jpcamara.com · Dec 18

A friendly PSA on git etiquette: Descriptive commits and clear PR descriptions are a gift. When I am investigating an issue or trying to understand some code - it makes me so happy when I see a relevant message and I can understand the _reason_ behind the code. It's a favor to future maintainers!

10 likes 7 replies

?

Replies

Ross Kaffenberger · Dec 18

I couldn’t agree more. Sadly, I have the impression this perspective isn’t widely shared judging by codebases I’ve worked in over the years.

Vadim Zaytsev · Dec 18

When I started everyone barely wrote commit messages, so I thought it would be poor form to be descriptive. lol. Commit messages, PR descriptions, YARD comments on functions, full descriptive variable names - I want it all. Not in the least because then I'll undertand my own months-old code...

Brandur · Dec 18

100%. I'm still trying to figure out how to best spread this practice at companies because I've never worked anywhere where the average length of commit title + message exceeds ~10 words. (Open-source tends to be a little better.) Unfortunately, leading by example isn't enough.

Will Carey · Dec 19

My curse is only ever writing these on commits I never reference again and having the “made it work” commit on the thing I need to reference later 😂

John Nunemaker · Dec 18

You don’t like wip, got it, finally, and try this as commits?

JP Camara · Dec 18

(to be clear, I am happy with ivo's message here!)

Tony Dewan · Dec 18

The _why_ is everything! I also love external links, though not as a replacement. Having worked on a codebase that moved git repo hosts and PM tools multiple times, the commit message is crucial for long term knowledge sharing.