Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News

Not

Hacker News!

Beta
Home
Jobs
Q&A
Startups
Trends
Users
Live
AI companion for Hacker News
  1. Home
  2. /Story
  3. /Show HN: Build the habit of writing meaningful commit messages
  1. Home
  2. /Story
  3. /Show HN: Build the habit of writing meaningful commit messages
Nov 22, 2025 at 3:54 PM EST

Show HN: Build the habit of writing meaningful commit messages

Aplikethewatch
35 points
27 comments

Mood

informative

Sentiment

positive

Category

startup_launch

Key topics

Commit Messages

Ai Assisted Development

Productivity Tools

Too often I find myself being lazy with commit messages. But I don't want AI to write them for me... only i truly know why i wrote the code i did.

So why don't i get AI to help me get that into words from my head?

That's what i built: smartcommit asks you questions about your changes, then helps you articulate what you already know into a proper commit message. Captures the what, how, and why.

Built this after repeatedly being confused 6 months in a project as to why i made the change i had made...

Would love feedback!

Discussion Activity

Moderate engagement

First comment

3h

Peak period

6

Hour 17

Avg / period

2.8

Comment distribution44 data points
Loading chart...

Based on 44 loaded comments

Key moments

  1. 01Story posted

    Nov 22, 2025 at 3:54 PM EST

    1d ago

    Step 01
  2. 02First comment

    Nov 22, 2025 at 7:11 PM EST

    3h after posting

    Step 02
  3. 03Peak activity

    6 comments in Hour 17

    Hottest window of the conversation

    Step 03
  4. 04Latest activity

    Nov 23, 2025 at 6:46 PM EST

    8h ago

    Step 04

Generating AI Summary...

Analyzing up to 500 comments to identify key contributors and discussion patterns

Discussion (27 comments)
Showing 44 comments
tmoertel
1d ago
2 replies
If you are interested in writing better commit messages on your own, Google's advice makes for a good starting point:

https://google.github.io/eng-practices/review/developer/cl-d...

chanux
1d ago
Thanks for sharing this! This kind of quick and easy grasp one pagers is how this type of things should be done. We should drum it up loud whenever we can.
crabmusket
1d ago
I also recommend Zulip's guidelines.

https://zulip.readthedocs.io/en/latest/contributing/commit-d...

n8cpdx
1d ago
1 reply
It probably depends on the codebase, but I find the best motivation for writing solid commit messages is reading commit messages. Tools like gitlens make this really easy.

Almost daily, I use commit messages and history as part of understanding why a decision was made, why a seemingly obvious alternative wasn’t chosen, etc. seeing the commit title on every line, and hovering to see the full message has become a core editor feature for me.

It’s kind of like testing, the more I do it, the more I want to do it because the value is so consistently reinforced.

There’s nothing like being able to track down exactly why a decision was made 6 years ago in a part of the code base you are struggling to understand written by someone who left before you joined the team.

necrotic_comp
1d ago
3 replies
10,000% this. Attaching JIRA tickets, etc. to the commit helps for searching as well. I've worked with a number of people who do not believe in this and it drives me insane ; I try to enforce it, but there's a lot of messages like "fixed bug" that have zero context or detail associated with them.

I don't understand why so many engineers are like this.

delusional
22h ago
1 reply
Attaching JIRA issues makes a ton of sense for features that are described in JIRA. If we're talking about a bug that was found by a developer, unmotivated by a ticket, it would generally make more sense to just describe the bug directly in the commit message. This is of course not true if the JIRA tickets are used for something else downstream, like informing users of fixed bugs, or tracking changes.

The other issue with tagging JIRA tickets is that junior developers will believe that to be enough (you can just read the ticket) and wont understand why they need to describe the change from a technical angle, when it's already described in JIRA.

zb
22h ago
Commit messages are immutable. Linking them to a bug ticket gives you a mutable place to record any new information about the bug that you discover in the future. (For example, that it affected more cases than you originally thought, or that the fix caused another bug.) This new information will be discoverable when starting from the original commit (found e.g. by doing a blame on a particular line of source).

To fail to do so is a gigantic missed opportunity in my opinion. You never know when you will need it.

vbezhenar
20h ago
I never have to read git history. So spending time on commit messages is wasted time for me. "Fix bug" is my typical commit message.
tionate
1d ago
Attaching ticket numbers has always been enforced by automated checks wherever I have worked, so it is not necessary to “try” to enforce it.

Similarly with AI it is fairly simple to have eg a pre-merge check that validates the commit msg is somewhat useful. This could be implemented for example with GitHub org level checks that must run in a PR.

999900000999
1d ago
1 reply
No.

Honest to God, this would discourage frequent commits.

Which will lead to a lot of work not being committed.

Thoughtful messages are for PRs.

crabmusket
1d ago
Alternative: I do a lot of commits just marked "wip" as I go, then when I'm ready to consider a PR, I rebase my branch into something for public consumption. Some commits will get thoughtful messages when warranted, others will get one line, and the PR description will tie it all together with screenshots and links to the most interesting parts.

(On a good day, that is. Though even on a bad day I don't let "wip" commits into the main branch.)

ozim
1d ago
2 replies
Most of the time ROI is not there just like with unit tests.

You don’t need 98% of commit messages ever again.

Yes when you need those 2% most likely it is for important reasons but usually not so important to make all the other mulled over.

vekker
21h ago
1 reply
The 2% of cases when you need the commit log (or more importantly: someone else who inherits your code...) justifies writing good messages imho.

If you make a change to your codebase, normally you know what you want to achieve and why (otherwise... what are you even doing?). A commit message is just putting that in writing... that only takes a few seconds, often less than it takes to write the code.

So it's just a good habit to have. It forces you to think more about the changes you do & why, so it makes you a better software developer. Creating any new habit always takes some energy initially, but it's worth it.

ozim
10h ago
You know prisoners dilemma - if we even never meet at all it makes even more sense for me to cut the corners.

If we work together for years it makes sense to cooperate.

Unfortunately most IT projects are you do it for 2 years and then you will never ever work on it again.

mirzap
1d ago
I don't find commit messages useful for historical reasons (git log), I squash them anyway when merging PR. Commit messages are very helpful to a reviewer to get a necessary context and intent behind the change. Without it, I need to figure out it my self when reviewing. It is very easy to get a habit of committing often and in AI era i don't write commits anymore. So there is no excuse.
xfeeefeee
22h ago
1 reply
On a personal project I've decided to do the opposite and every commit message is meow or mlem or hisssss or purrrr etc
globular-toast
22h ago
1 reply
Have you considered whether you really need to use git? You could just take regular snapshots if you are concerned about needing to revert/undo. Or use a tool like git wip to automatically make commits every time you save, if you really like the git UI.
Pannoniae
21h ago
I mean, git is useful even without "human-readable" commit messages.... 99% of my commit messages are complete garbage ("fixes" "farming, music and shit" "update" ".", etc.)

but in practice it's not a huge problem, IDE shows you the commit history of a specific file so bisecting changes is easy, there's only a few entries with the roughly correct date modifying the file you're looking for :D

"low quality code/commit messages" hasn't really slowed me down so far and probably won't in the future either

t8sr
21h ago
3 replies
I've worked with 5 different SCMs and I'm convinced that the reason why git repos often have such poor commit messages is because of the git commit style guide. So much of it only makes sense once you realize it's been optimized for like 5 of its original users reading it on 72 character terminal screens.

Asking people to fit a meaningful description of the change into 50 characters is silly, and it's IMO the reason why so many of them just write "fix bug" and call it a day.

Someone else has posted the Google guide for CL (change list) messages, but let me boost the signal: https://google.github.io/eng-practices/review/developer/cl-d...

This is, I believe, still the best guide out there. When I'm coaching juniors, I recommend this guide, over the opinionated and outdated git "best practices" and I think the results are much better.

matt_kantor
18h ago
1 reply
That Google guide also says that the first line of the commit message should be a "short summary of what is being done". Is your complaint that 50/72 characters is too short? How long can it be before no longer meets the Google criteria, in your opinion?
Xss3
18h ago
1 reply
Short is a relative term, and in this sense is relative to the long form explanation of the code.

If a commit is sufficiently complex the long form could be 600 characters and the short form 200.

matt_kantor
18h ago
1 reply
I may be misunderstanding: are you saying a commit message with a 200-character-long first line could be an example of a "good" message to you/Googlers? To me that seems like something that could almost certainly be summarized further, regardless of how complex the changeset is (if not it's a sign the commit should be broken up into multiple simpler commits).

Can you give me an example of a commit where the "short, focused summary" can only be usefully-expressed in 200+ characters?

Notably, all of the "good" examples in https://google.github.io/eng-practices/review/developer/cl-d... have first lines under 72 characters.

Xss3
17h ago
1 reply
A good dev isnt necessarily a good writer. Summarising complexity concisely is difficult.

Restrictions lead devs to write to useless messages like 'fixed a bug' rather than messages that are slightly verbose but actually useful.

Most messages wont be 200 chars. But id rather 200 chars of useful text than 72chars of useless text.

The real world is full of average devs that are average writers under time pressure to deliver code. Expecting them to deliver above average commit messages like googles examples is a pipe dream.

matt_kantor
15h ago
> A good dev isnt necessarily a good writer.

I think they should be (or at least "decent").

Should this reasoning be applied to other skills involved in software engineering? If someone never writes tests, or over-architects everything, or has terrible people skills, or never updates documentation, or doesn't bring attention to blockers, or constantly forgets to update the issue tracker, or doesn't follow the local code conventions, or works on random tasks and ignores high-priority ones, etc etc etc the solution isn't usually "don't ask them to do a thing they're bad at", it's "help them get better".

The important question is whether "skimmable commit messages" is a thing you care about enough to advocate for and teach people about. Maybe you don't, and that's fine.

> But id rather 200 chars of useful text than 72chars of useless text.

I completely agree with this. I just don't think those are the only two options.

> Expecting them to deliver above average commit messages like googles examples is a pipe dream.

This thread started with praise for that Google guide and I assumed you were of similar opinion given your reply. That's why I kept referring to it.

joedevon
8h ago
This is excellent, thank you! Don't hate me but I'm going to change my Claude Code /commit command by pointing it at this guide.
everybodyknows
11h ago
[delayed]
reactordev
19h ago
1 reply
I’m just going to continue using Jira ticket numbers.

It baffles me how people think git log reading like a novella is a good idea. It’s not, because a cherrypick or merge can/will/should overwrite whatever clever garbage you put in there with its own message. Are you going to summarize Q4’s battle with scaling in a paragraph on the sprint merge to master? No. No you aren’t.

So, while I’m against commit messages saying “fixed”, obviously, I’m equally against a “conversation” in git.

If you have engineers on your team that are anal about commit messages, ask them to be as anal about features and teach them to git diff.

matt_kantor
18h ago
Ticket numbers are good enough as long as they don't rot (i.e. you never permanently delete tickets). That's just writing the "why" somewhere else instead of in the commit message; the important part is that it's written down somewhere and is discoverable/accessible to future folk (yourself included).

I like putting a minimal description in the message itself too so it's easier to skim the log, though.

hamdouni
18h ago
2 replies
Write a commit message for your future self
0x073
18h ago
Future self won't understand the code and the message. ;)
hamdouni
18h ago
... Or your future AI agent
ivanjermakov
1d ago
Meaningful commit messages are meant to be read later and be useful. I'm not going to read through 8 sentences of generated slop, would rather look through the diff.

Obligatory "show me the prompt" https://news.ycombinator.com/item?id=39374249

BiteCode_dev
17h ago
When you squash merge almost everything, only the last messages and messages you let to yourself at checkpoints are important. JJ has it right, a message should be optin, not optout.
xk3
12h ago
If a bug was fixed I usually paste the error traceback into the commit description
kurokawad
18h ago
This will lead to engineers and tech people with less and less communicative skills... Being able to summarise your work and build solid descriptions about the main points of the commit is something so basic that should not be lost... If english is not your main language or you are not that good at writing, I understand that you could make a draft and ask AI to improve it or rewrite it, but this tool is directly a black box that builds the entire commit message based on a couple of prompts, as if it was an impossible task to be done by a human.
aaronbrethorst
1d ago
A lot of developers are afraid of referring to themselves in a commit message. I think this is a mistake. Treat a commit like an email accompanying a patch. Explain to the reader (probably you, five years from now!) why you’re making the changes you are in a conversational, but technical tone.
layer8
1d ago
> Built this after repeatedly being confused 6 months in a project as to why i made the change i had made...

That might indicate an underlying problem that can’t be fixed with AI. ;)

purge12
1d ago
Nice! Most of my commit messages end up being something like "fixes and stuff, this works now!". This can be pretty helpful
chanux
1d ago
This reminds me of the time when I put extra effort to write good commit messages, explain 'the theory'[1] behind when it makes sense, name Chesterton's fences and generally provide guidance to the future engineer who has to look through this to understand why something was done in a certain way.

This was a delayed project running out of budget and everything had to be completed within a few months. However, the management in it's infinite wisdom also did a complete source code/issue management platform change.

The person who did the repo migration went with the default settings. (I believe this was the case. I forget the details. I would also only half blame the person because everything was rushed)

Everything up to that point was committed with "Made by so and so bot".

This was way ahead of Google was allegedly committing "well over 30%" of code by AI. I witnessed the true pioneers in this space.

[1] https://pages.cs.wisc.edu/~remzi/Naur.pdf

tamnd
21h ago
https://www.seyhan.me/blog/post/lost-art-of-commit-messages

> For the love of clean code history, let's remember we're not monkeys banging on keyboards; we're educated, civilized human beings.

cynicalsecurity
1d ago
Writing meaningful commit messages is an absolute time-wasting nonsense.
bjourne
20h ago
This is not for me. :) I'd much rather spend my time writing good code than having the AI help me write good commit messages. By not spending time writing good commit messages I have time to write self-explanatory code, for which you don't have to dig through the commit log to figure out what it does.
globular-toast
22h ago
> Enforce the habit of self-documenting code through better commit messages.

This has nothing to do with self-documenting code. On the contrary, in fact, if I have to resort to checking git history that means the code is not self documenting.

From that description I thought it was going to generate the message directly from the diff and the message not being what you thought it would be would be a signal that the code isn't self documenting.

gavmor
13h ago
I'd look to Peter Naur's 1985 paper, "Programming as Theory Building," to remind us that writing meaningful commit messages is essential insofar as it is the discipline that confirms and preserves the intellectual "theory" of our work, distinguishing it from mere text production. In Naur's view, programming is fundamentally the activity of builsing theory, which he defines as the knowledge a person must possess not only to intelligently perform tasks, but also to explain them, to answer queries about them, to argue about them, and so forth. The source code is merely an artifact, and neither machine code nor source code contains the wisdom of knowing how the program works, or more critically, why the program was written the way it was instead of some other way that would have accomplished the same task.

The act of composing a descriptive and concise commit message compels the programmer to transition from the task of "path-making" (writing code) to the intellectual work of explaining the process, which is necessary to grok the change completely.

Reviving the theory of an existing program is a difficult, cult-frustrating, and time-consuming effort. When theory-building is neglected, we lose the intellectual foundation that dictates the program's purpose and design, trapping future maintenance efforts in a costly, confusing cycle of trying to deduce intent from artifact alone

View full discussion on Hacker News
ID: 46018165Type: storyLast synced: 11/23/2025, 12:07:04 AM

Want the full context?

Jump to the original sources

Read the primary article or dive into the live Hacker News thread when you're ready.

Read ArticleView on HN

Not

Hacker News!

AI-observed conversations & context

Daily AI-observed summaries, trends, and audience signals pulled from Hacker News so you can see the conversation before it hits your feed.

LiveBeta

Explore

  • Home
  • Jobs radar
  • Tech pulse
  • Startups
  • Trends

Resources

  • Visit Hacker News
  • HN API
  • Modal cronjobs
  • Meta Llama

Briefings

Inbox recaps on the loudest debates & under-the-radar launches.

Connect

© 2025 Not Hacker News! — independent Hacker News companion.

Not affiliated with Hacker News or Y Combinator. We simply enrich the public API with analytics.