I've got a new blog post up at Meedan (where I work). It's about longform git commits: what they are and how they can make your life as a software developer easier.
My spiciest git take is you should ban "-m" from your git repertoire and go full verbose invoking a text editor from the CLI to write commits.
https://meedan.com/blog/how-to-write-longform-git-commits-for-better-software-development/
My spiciest git take is you should ban "-m" from your git repertoire and go full verbose invoking a text editor from the CLI to write commits.
https://meedan.com/blog/how-to-write-longform-git-commits-for-better-software-development/
How to write longform Git commits for better software development
On the Meedan engineering team we are trying to clean up the way we write Git commits in order to help our engineers communicate more clearly with one another andMeedan
reshared this
Stacey Campbell
in reply to Darius Kazemi • • •colin mitchell
in reply to Darius Kazemi • • •Aram Zucker-Scharff
in reply to Darius Kazemi • • •Darius Kazemi
in reply to Aram Zucker-Scharff • • •Aram Zucker-Scharff
in reply to Darius Kazemi • • •Emacsen
in reply to Darius Kazemi • • •The first line (what you're calling the subject line) of a git commit message really aught to be a simple "<verb> <subject>", but then you're right that there's room for more detail.
I'm still struggling to get some devs to perform good commit messages.
Martin
in reply to Darius Kazemi • • •mcc
in reply to Darius Kazemi • • •Darius Kazemi
in reply to mcc • • •Ro
in reply to Darius Kazemi • • •vx. size_t queen grace :qvp:
in reply to Darius Kazemi • • •keithzg
in reply to vx. size_t queen grace :qvp: • • •keithzg
in reply to keithzg • • •keithzg
in reply to keithzg • • •> BugID:999 - Commit fix
which means reading back through the commit log *requires* cross referencing our bugtracker.
clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛 likes this.
Evan
in reply to Darius Kazemi • • •I don't know that I've ever convinced anyone, though…
Darius Kazemi
in reply to Evan • • •Something that I didn't mention in the article is it's a way of documenting like... how MUCH work went into a commit. Sometimes you have a ~1 line commit that took you all day. A verbose commit is where you can really show your team why that took all day (and it is likely to help someone in the future since tiny changes with huge ramifications should be well-documented!)
clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛 likes this.
Evan
in reply to Darius Kazemi • • •Darius Kazemi
in reply to Evan • • •alexandra catalina
in reply to Darius Kazemi • • •Darius Kazemi
in reply to alexandra catalina • • •Darius Kazemi
in reply to Darius Kazemi • • •Scott Feeney
in reply to Darius Kazemi • • •When you say ban "-m", surely you mean except for WIP/checkpoint commits that will be rebased/squashed later, right?
Darius Kazemi
in reply to Scott Feeney • • •What I like about having this in git is that it stores the important information in git rather than in github dot com
clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛 likes this.
Max
in reply to Darius Kazemi • • •(Plus then you can use tools like —first-parent with merge commits.)
Darius Kazemi
in reply to Darius Kazemi • • •https://meedan.com/jobs
Jobs
Meedanreshared this
Darius Kazemi, Ro, L.J.'s Restless Brain Syndrome and Beko Pharm reshared this.
Gidi Kroon
in reply to Darius Kazemi • •I also dislike
git -a
though...Now I want to see that programming language that doesn't support multiplication...
Darius Kazemi
in reply to Gidi Kroon • • •Gidi Kroon likes this.
Darius Kazemi
in reply to Darius Kazemi • • •Gidi Kroon likes this.
Ed Summers
in reply to Darius Kazemi • • •codl
in reply to Darius Kazemi • • •Darius Kazemi
in reply to codl • • •Michael McClimon
in reply to Darius Kazemi • • •clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛 likes this.
reshared this
Darius Kazemi and clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛 reshared this.
Darius Kazemi
in reply to Michael McClimon • • •CMDR Yojimbosan
in reply to Darius Kazemi • • •Darius Kazemi
in reply to CMDR Yojimbosan • • •Sven "DrMcCoy" Hesse
in reply to Darius Kazemi • • •When you feel the urge to write a lot in the commit message, a part of it should probably go into a comment in the code instead, so that the reasoning behind a piece of code is directly accessible there
Description why/how something *is* -> code comment
Why something was changed -> commit message
Darius Kazemi
in reply to Sven "DrMcCoy" Hesse • • •Sven "DrMcCoy" Hesse
in reply to Darius Kazemi • • •I run Gentoo on my personal machines. I more than once had to investigate why a package suddenly broke compilation on an update (especially when I have set an uncommon set of USE flags). I usually have to dive into the code there and that's usually from a release tarball without git repo
🕸️ Mercurial Madeline 🕸️
in reply to Darius Kazemi • • •The first line should be an overview, and be 50 characters or less.
Put as much information as you want in the body, but keep it at the right line limit. I believe it's 72 for the body.
clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛
in reply to Darius Kazemi • • •-m
all the time for multi-line commit messages!clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛
in reply to clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛 • • •The point about punctuation is a good one, and I will ususally commit with a draft message from the CLI and then immediately run
git commit --amend
to fix it up a bit.But then I will also most of the time run interactive rebases and fix things up, both code and messages, before pushing things.
I will take this moment to evangelize
--rebase-merges
which is an absolute godsend and really helps with separating things into focused, topical PR branches.:flan_reaper:
in reply to clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛 • • •clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛
in reply to :flan_reaper: • • •git lg
[0] which features will be included in the deploy and we will put ticket numbers in the release notes too, and in the subject of mails discussing aspects of a feature, etc.[0] basically a
git log --graph --decorate --oneline
but with a little bit more candy, see https://gitlab.com/clacke/gists/-/blob/master/.config/git/config#L4L.J. but extra nerdy
in reply to Darius Kazemi • • •Mark Stosberg
in reply to Darius Kazemi • • •Now, …
Issue: CMO-123"
clacke: inhibited exhausted pixie dream boy 🇸🇪🇭🇰💙💛
in reply to Mark Stosberg • • •Jeff Ward
in reply to Darius Kazemi • • •Darius Kazemi
in reply to Jeff Ward • • •