Before the AI era, I wrote pretty long commit descriptions (or commit bodies) for major changes. It took me about five to ten minutes to draft and reread them to make sure I didn’t miss anything important. I did that…

103 points•yedhukrishnan•about 8 hours ago•59 comments•

59 comments

WD-42about 6 hours ago
Writing is thinking in every situation, not just limited to commit messages. This is a fact that I'm concerned people are forgetting, or worse never understood to begin with.
bunderbunderabout 4 hours ago
I returned to doing a lot of my own coding for this reason.

I don't mind farming out the more monotonous bits to AI. When I was letting an agent handle the whole implementation for me, though, I found that I was rediscovering all the pitfalls of waterfall-style development. Because I was doing waterfall-style development. I was trying to pin down all the details in a plan document up front, which is inevitably the point in time where I know the absolute least about the best way to accomplish the task. And then I let the agent do the rest for me, which undermines my opportunity to learn and understand more.

The result was continual accumulation of bad decisions and unnecessary technical debt. The only difference between now and back in the bad old days of 20 years ago is this time instead of being the put-upon code monkey I had become the boneheaded engineering manager who isn't paying attention to the code and doesn't realize what a brittle mess it's become.

fasterikabout 6 hours ago
This. I've recently (re-)discovered the importance of using writing to force myself to confront my assumptions and gaps in knowledge. It's easy to fool yourself into thinking that you understand something if you haven't made it concrete and explicit by exercising your own brain. Arguably, this extends beyond writing in the conventional sense to many cognitive domains: mathematics, programming, physics, engineering, etc. AI should help the process of thinking, not replace it.
msdzabout 5 hours ago
Your point rings home hard to me at the moment, as I’ve recently been trying to write up several small-ish topics in blog form, so as to have a link ready to share when an oft-discussed topic inevitably comes up again online, and some of those arguments, while I had read up on them in the past, include things I’m not entirely familiar with.

And I’ll just say, after this exercise I can definitely concur that writing exposes gaps in your thinking very fast. Especially when you’re trying to explain your point to someone who is new to the topic.

    "Writing is nature's way of letting you know how sloppy your thinking is."
– Dick Guindon
ModernMechabout 5 hours ago
Did you think about this comment or are you just repeating something you heard and that’s been said in every discussion on HN about writing and AI?
WD-42about 5 hours ago
I read the linked article, thought the idea was generalizable, and posted that thought. Something wrong with that?
1718627440about 5 hours ago
Recalling, recategorizing and expressing is still thinking?
dkarlabout 5 hours ago
I was forced to give up on commit messages long before AI, because other people were so bad at them that I happily agreed that all PRs should squash commits.

At least then the squashed messages were usually pretty decent. But then people started using AI (or AI started using people) to create absolutely massive commit messages that are impossible to skim in git blame and overall very bad for human consumption.

AI has made massive strides in virtually every other way. Why do they continue to write in a wasteful, human-hostile way?

I think we'd have to be be very naive not to suspect that this is intentional. AI companies have a stated goal of replacing humans in the software development process, and they're actively making the process itself inhospitable for humans.

They are injecting massive amounts of text into their customers' development process, which then becomes tokens that their customers will then pay them to process over and over again. It's like a CO2 scrubber that emits CO2.

luipugsabout 3 hours ago
I suspect there's a prompt one can add to improve the consumption of commit messages for humans, just that the default one is pretty bad. Kind of similar to the AI generated posters a few weeks back: https://news.ycombinator.com/item?id=49764791.
kccqzyabout 7 hours ago
Long ago I changed the default commit message to include headers “Why?” and “How?” to remind myself that I need to explain why a change is made (what this article focuses on), and how it is made (different implementation approaches considered). I followed this format for a long time. I was in the top 1% for commit message length at the company.

Tangent: I once worried about things breaking when commit messages got too long. I tried really long commit messages and nothing broke: https://github.com/kccqzy/long-commit-messages/commit/ccfda4...

lokarabout 4 hours ago
Why make this change at all? Why do it this way? What would have been the next best way, and why not that? What important assumptions justify this? What's next for this? etc
cervedabout 6 hours ago
I like the Git rule of thumb. If it's too long -- it's probably not a single commit.
sublinearabout 7 hours ago
To stay concise, I think bullet trees are the best. I've never had to make exceptions to this format.

Top level groups high-level concerns (optional). Below that (required) are short distillations of those concerns answering "why". Below that are descriptions of "what" was/wasn't done. A final optional level digs into deeper implementation detail.

The vast majority of my bullet trees are just those two required levels. Each commit message is rarely more than 10 or 15 lines long, and people really appreciate them. I appreciate them too since I'm the most likely to read them.

tommicaabout 6 hours ago
Got an example of what you mean?
evnpabout 5 hours ago
> When the AI doesn’t know the ‘why’ part, it comes up with its own reasoning. I find that dangerous. When we read that later, it may not make sense, because the real reason was completely different.

Even more dangerous: when the text _does_ make sense, despite being detached from reality.

fphilipeabout 4 hours ago
I have this rule in my global AGENTS.md:

> When writing a commit message, briefly explain at a high level what was done (the details are in the code). Explain the why of the commit; if you don't know that, ask me.

It works quite well. When it doesn't have it in context, it does ask.

arialdomartiniabout 6 hours ago
On top of this, it pays off to write the commit messages before the code

https://arialdomartini.github.io/pre-emptive-commit-comments

drdaemanabout 6 hours ago
Jujutsu is perfect for that - you create new changeset upfront, providing message at the same time (which can be later amended as needed). Feels so much more logical to declare the topic first, rather than come back to some accidentally uncommitted changes and wonder what was doing there.
arialdomartiniabout 5 hours ago
Exactly! For anyone interested, I guess the previous comment refers to the Squash Workflow, which happens to be very idiomatic in Jujutsu

https://arialdo.codeberg.page/ju-ju-tsu/tutorial/moving/squa...

xixixaoabout 6 hours ago
"Topic" is usually covered by branch name. Commit message goes with a set of code changes, it feels more logical to me for the message to describe the actual code as it was written (as it might have changed from the idea phase).
1718627440about 5 hours ago
You can start to write the commit message first in Git too. (And I do that.)
TeMPOraLabout 5 hours ago
Agreed. You can preplan a bunch of small steps and then fill in changes.
tommicaabout 6 hours ago
On hindsight that should be obvious! Pre-write your commit message, because of course you know what you are going to work on!
Sarkieabout 6 hours ago
BDD. Absolutely changed my world
Garlefabout 5 hours ago
As in gherkin/cucumber? Or more generally?

(the language... I, for the love of it, can't remember which is which)

Read the full thread on Hacker News →

Related stories