DEV Community

Cover image for I Asked AI to Write My Commit Messages It Was Embarrassing.
Harsh
Harsh

Posted on • Edited on

I Asked AI to Write My Commit Messages It Was Embarrassing.

Human context for future maintenance

I asked AI to write a commit message for me last week The code change was simple. A bug fix One line, easy to explain in a single sentence if I'd bothered to think about it for ten seconds.

The AI wrote:

Updated stuff. Fixed things. Improved performance.

That was it Four words of pure, unhelpful weapons-grade nothing I stared at it. Then I closed the tab. Then - for reasons I can't fully explain - I reopened it and stared at it again, as if it might improve on a second viewing.

I couldn't ship it. Not because it was technically wrong. Because it was soulless. It told a future reader absolutely nothing about what had happened, why it had happened, or whether it mattered.

That's when it hit me: AI can write code. It apparently cannot write a message that sounds like a human who gives even a small amount of a damn.

Here's what happened when I let AI write my commit messages for a week -and why I'm never doing it again.


What Commit Messages Used to Mean

I used to actually spend time on commit messages.

Not hours. Not a whole production. But enough - a sentence that explained the why not just the what A brief note about a trade-off I'd considered and rejected. Sometimes a link to the ticket. Sometimes a one-line explanation of a genuinely weird edge case that future-me would otherwise stare at in confusion.

The message was never really for the code itself. The code speaks for itself, eventually, if you read it carefully enough. The message was for the next person the one who'd find this specific commit six months later, mid-debugging-session, wondering why on earth did anyone do it this way.

A good commit message is a small specific gift to your future self or to whoever inherits your code next.

I genuinely hadn't noticed I'd stopped giving that gift Not until I handed the job to AI and got back a perfect mirror-clean reflection of exactly how little effort I'd been putting in.


The AI's Commit Messages: A Gallery of Shame

Here's what the AI produced for my last three actual commits I'm sharing these because I think you'll recognize the genre even if you haven't seen these exact words.

1 Fixed stuff.
Three words. Zero context. Not the faintest clue what was fixed, why it needed fixing, or whether anyone should care.

2 Improved performance.
By how much? Where in the codebase? Through what mechanism? Compared to what baseline? The message answers none of these and somehow still manages to sound confident about it.

3 Bug fixes and other improvements.
This might be the most generic sentence that has ever existed in the English language It is, technically, true of almost every commit ever made by anyone.

The AI had access to the actual diff. It had seen exactly what changed, line by line. And given all that information, it chose to communicate essentially nothing.

Here's the part that actually got to me: these messages aren't even useful to another AI. If a different model reads "fixed stuff" in six months while trying to understand the history of this file, it gets exactly as much signal as a human would which is to say, none.

The commit message wasn't really the problem. It was a symptom. I had quietly stopped caring about the story of my own code, and the AI trained to be helpful and inoffensive - just mirrored that indifference straight back at me, dressed up in complete sentences.


Why This Actually Matters

Commit messages aren't just decoration on top of Git history. They're not busywork.

They're for the teammate who finds this code in six months and needs to understand why a decision was made before they touch it They're for the person doing a code review who's trying to evaluate whether a change is reasonable. They're for you - specifically you, at 2 AM, staring at a stack trace, trying to remember what you were thinking when you wrote this.

A good commit message answers one question clearly: why did we do this?

A bad commit message answers nothing, while taking up exactly as much space as a good one would have.

The AI gave me generic, hollow commit messages because - and this is the uncomfortable part - I had already been giving generic, hollow commit messages for a while before I asked it to take over. It learned the pattern from my own recent history. It reflected my laziness back at me with perfect fidelity and zero judgment.

That's the part that actually embarrassed me. Not the AI's output. Mine.

The AI wasn't the problem. I was, and the AI just made it visible.


The Lesson

I'm back to writing my own commit messages.

Not because I have some rule against AI assistance in general - I use it plenty for other things. But because I realized somewhere in this process that the commit message was never really meant for a computer to generate. It's meant for a human to read, and it should sound like it was written by one who was paying attention.

The AI can write the code. It can refactor, suggest, generate, autocomplete. What it apparently can't do - at least not without me actively caring first - is write the story of why a change happened. And the story is the part that actually matters, to the next reviewer, to the next maintainer, to future-me debugging something at an hour I'd rather not specify.

I don't need AI to write my commit messages.

I just need to care enough, for about fifteen seconds per commit, to write them myself.


One Question

What's the worst commit message you've ever seen - or, if we're being honest with each other, written yourself?

I'll go first: "Fixed stuff."

I'm not proud of it. But I stand by sharing it.

Your turn. πŸ‘‡

Top comments (35)

Collapse
 
leob profile image
leob

Yes, that's what commit messages are for - for your future self (or someone else) who views the commit history of a file and wonders "why the heck did he/we make this change??"

What works well for me, if/when my work is driven from tickets (Jira, Trello, whatever) is to simply put the ticket number in the commit message ...

If the tickets are granular (not huge catch-all tickets for a whole month of development), and if the tickets contain relevant and detailed info, then just being able to look up the relevant ticket can make all the difference - you'll know the full background and context, which probably tells you WHY you made that change ...

(most of the time my git feature branch would also contain the ticket number, but normally I'd delete those branches after merging them, so adding the ticket number to the commit message just makes sense)

Collapse
 
harsh2644 profile image
Harsh

Leob ticket number in the commit message is the simplest, most practical tip Because the ticket has the conversation. The ticket has the context. The ticket has the why The commit message just needs to point to it.

If tickets are granular not huge catch-all tickets for a whole month this is the key Granular tickets useful context. Huge tickets useless context.

I've definitely been on both sides. And you're right the ticket number saves future-you from the why did I do this? moment.

Thanks for the practical addition. πŸ™Œ

Collapse
 
itskondrat profile image
Mykola Kondratiuk

Ran into this with agents writing commit messages for test fixes. First pass was always some variant of update tests with no context on WHY. Required a previous-behavior / new-behavior / why-changed format after that. Revert rate dropped.

Collapse
 
harsh2644 profile image
Harsh

Mykola previous-behavior new-behavior why-changed that's the format The AI gave you update tests That's the what The format forces the why what was wrong, what changed, and why it mattered The revert rate drop proves it. When the message actually explains the change, people don't have to guess Less confusion fewer reverts.

This is the difference between AI wrote a message and AI wrote a useful message The format does the work.

Thanks for the practical tip I'm stealing this. πŸ™Œ

Collapse
 
itskondrat profile image
Mykola Kondratiuk

the revert rate is the right signal tbh - not whether the format was followed but whether people stopped having to dig through context later. those are different things.

Collapse
 
nark3d profile image
Adam Lewis

The reason it writes 'updated stuff' is that the why was never in the diff - the model can only see what changed, not why you changed it, so it paraphrases the patch back at you. A commit that restates the what is just a worse version of the diff. The one worth writing carries the reason the diff can't: what was broken, why this fix and not another. That part still has to come from you, or be written down somewhere the agent can read it.

Collapse
 
harsh2644 profile image
Harsh

Adam this is the most precise explanation in the thread. Thank you A commit that restates the what is just a worse version of the diff That's it The diff already shows what changed The commit message is useless if it just repeats that The message needs to carry the why the reason that isn't in the code The model can only see what changed, not why you changed it This is why AI commit messages are hollow by default. The AI isn't being lazy it's being accurate It only knows what the code says, not the context that led to the change.

That part still has to come from you, or be written down somewhere the agent can read it The insight The AI can't infer the why. It needs the why to be explicit If you don't write it in the ticket, in the spec or in the prompt, the AI can't know it.

Thank you for the precision this is the best comment in the thread. πŸ™Œ

Collapse
 
cart0ne profile image
Cartone • Edited

I was lucky enough to start my projects using AI and I have to say, even though at the beginning I didn't know what a commit was πŸ˜…, I realized over time that it actually always wrote them pretty well (at least for me) and we often use them precisely as a source of past memory together with state files. So I imagine the problem of imprecise commits might come from the AI not having direct knowledge of the code.
This is one of its commits πŸ™‚
translated by Claude

Collapse
 
harsh2644 profile image
Harsh

Cartone honest line charts – straight segments (tension 0) this is actually a good commit message It explains the problem (smooth splines inventing values), the fix (straight segments), the context (Dashboard Β§3, /income P&L), the technical detail (Chart.js tension), and even why it matters (radical-transparency site).

The AI wrote this because I'm guessing you gave it the context. The code change, the ticket, the why. When the AI has the context, it can write a message that tells the story My AI wrote Fixed stuff because I didn't give it anything to work with.

Turns out: you get out what you put in. πŸ˜‚

Thanks for the example this is the other side of the coin. πŸ™Œ

Collapse
 
twrty_connect profile image
twRty Connect

"Updated stuff. Fixed things." is genuinely the funniest and most relatable AI fail I've read this week.

The core issue is that AI optimizes for plausibility, not meaning β€” and commit messages (like good blog posts) require a human who knows why something changed to write them properly.

At twRty we build AI writing tools, and the lesson we keep learning: AI is excellent at structure and speed (generating a full, formatted blog post in seconds, publishing to 15+ platforms instantly β€” twrty.org/blogboat), but the why and the voice still need a human author.

The best use of AI in writing is as a first drafter β€” not a final publisher of your intent. Sounds like you figured that out the hard way, same as we did!

Collapse
 
harsh2644 profile image
Harsh

Thanks for the thoughtful comment! You've perfectly articulated what I was trying to get at AI optimizes for plausibility, not meaning. That's exactly why my commit messages sounded so hollow. It knew what a commit message should look like, but had zero clue about the why behind my changes.

I really appreciate the perspective from someone building AI writing tools. That distinction is crucial: AI for structure and speed, humans for intent and voice. It's a healthy framework for all of us to adopt.

Your tool sounds genuinely useful generating a full, formatted blog post in seconds and publishing to 15+ platforms is no small feat. That's a massive time-saver for creators. I'm curious though: since you mentioned the why and voice still need a human, how does twRty approach that? Do you offer different writing styles or personas, or is it more of a get the draft out fast and let the human polish engine? I'd love to understand that balance better.

And yes, I definitely learned this the hard way but honestly, embarrassing AI failures make the best stories, right? πŸ˜„

Thanks again for reading and sharing your insights. Going to check out BlogBoat now!

Collapse
 
rodatdoh profile image
Rod Falanga

Where I work there was one guy, who thank God has left, who couldn't care less about documenting anything he did in a commit. So, his typical thing to do was to roll his fingers over the keys. If GitHub complained, then he'd choose other keys to roll his fingers over. So, his commit messages looked like this:

asdfgh

And there you go.

Collapse
 
harsh2644 profile image
Harsh

asdfgh honestly, I almost respect the commitment to chaos. πŸ˜‚No pretense of meaning. No Fixed stuff pretending to be useful. Just pure, unfiltered keyboard rolling.

My AI wrote Fixed stuff. At least it tried. Your ex-colleague didn't even bother to pretend.

Thanks for the laugh and the reminder that AI commit messages could always be worse. πŸ™Œ

Collapse
 
sloan profile image
Sloan the DEV Moderator

Hey, this article appears to have been generated with the assistance of ChatGPT or possibly some other AI tool.

We allow our community members to use AI assistance when writing articles as long as they abide by our guidelines. Please review the guidelines and edit your post to add a disclaimer.

Failure to follow these guidelines could result in DEV admin lowering the score of your post, making it less visible to the rest of the community. Or, if upon review we find this post to be particularly harmful, we may decide to unpublish it completely.

We hope you understand and take care to follow our guidelines going forward!

Collapse
 
harsh2644 profile image
Harsh

Hi Sloan thanks for the heads up I used AI to help structure the post and organize my thoughts, but the experiences the Fixed stuff commit message, and the voice in the article are my own. I'd estimate about 10% of the writing is AI-assisted I've added a disclosure at the bottom of the post per DEV's guidelines.

I'll be more mindful of this going forward appreciate the reminder Thanks,

Collapse
 
urmila_sharma_78a50338efb profile image
urmila sharma

Loved this read! It’s such a relatable experience. I think the key takeaway here is that AI tools are great assistants, but they still need human context and oversight especially for something as nuanced as commit messages. Thanks for sharing your honest experience!

Collapse
 
harsh2644 profile image
Harsh

Urmila human context and oversight that's the line AI can generate It can't know what mattered about the change That's the part that still needs a human who was there.

Thanks for reading and for the kind words. 😊

Collapse
 
profide profile image
ProfiDE

For complete mastery of commit management and write the message which describes all changes in the best way, you have to KNOW CONVENTIONAL COMMITS!

AI is here to assist you and help when you don't have an idea. But If you use just use AI and put your brain in halt mode 😁, you never get a good result and learning process won't happen.

In the end, if you don't understand all parts of a commit message, you can't write a good one.

Collapse
 
harsh2644 profile image
Harsh

ProfiDE if you put your brain in halt mode, you never get a good result that's the whole point, isn't it?

AI is a tool, not a replacement. It can help when you're stuck, but if you use it to avoid thinking, the learning stops The commit message isn't just about describing the change it's about understanding the change. If you can't explain what you did, did you really understand what you did? If you don't understand all parts of a commit message, you can't write a good one.

Exactly. The message is a mirror of your understanding.

Conventional Commits are great they add structure. But structure without understanding is just scaffolding with no building.

Thanks for the practical addition. πŸ™Œ

Collapse
 
m_saad_ahmad profile image
M Saad Ahmad

I write my own commit messages. The ones AI write is full of jargon that I find unhelpful to remember. Even if the commit is just one line change, I write something like "Just a small small tiny fix of line no. 232 of 'index.html' file". That way I can easily remember what I did and not have to go to the code history and check what I did.

Some comments may only be visible to logged-in visitors. Sign in to view all comments.