Comment by samtheprogram

Comment by samtheprogram 3 hours ago

10 replies

YOU should be writing your commit messages, not an AI.

You can always generate a new commit message (or summary, alternative summary, etc) down the road with AI. You can never replace your mind being in the thick of a changeset.

crabmusket an hour ago

If we assume, as many do, that we are going to delegate the work of "understanding the code" to AI in the coming years, this surely becomes even more important.

AI writing code and commit messages becomes a loop divorced from human reasoning. Future AIs will need to read the commit history to understand the evolution of the code, and if they're reading poor summaries from other AIs it's just polluting the context window.

Commit messages are documentation for humans and machines.

ekropotin 2 hours ago

I have completely opposite opinion on this.

Writing commit messages is one of these mundane chores I’d gladly delegate to LLMs which are very very good at this kind of thing.

I mean, if you really know you code, you know it, there is no much value in reinforcing it in your head one more time via writing comprehensive commit messages - it’s a waste of time, imho.

  • kace91 an hour ago

    Neither the code nor the AI know WHY a commit it being made.

    This context should at the very least be linked.

    • salomonk_mur an hour ago

      Man, 99% of non-bug-fix commits don't have a why other than "advance the current task".

      Almost all commits live in tandem with some large feature or change being made. The reason for absolutely all of them is the same - build the thing .

      • kace91 an hour ago

        >other than "advance the current task"

        How do you expect someone to know what “the current task” was when they’re tracking down a bug 2 years down the line?

      • crabmusket an hour ago

        Then write that and link to the current task. That's the why. You don't need an LLM for that.

  • [removed] 2 hours ago
    [deleted]
  • lelandbatey 2 hours ago

    Sounds like you haven't been working long enough to forget your decisions, which you WILL do eventually. In such cases, where you're looking at code you wrote 10 years ago and you find a weird line, when you view the git blame and read the commit message, you'll be very thankful that you explain not just "what" you did, but "why" you did this, something an AI will have a very hard time doing.

    You don't have to if you don't want to, but if you think "this commit message is just a summary of the changes made", you'll never write a useful commit message.

    • ekropotin an hour ago

      I’ve been working in the industry for two decades, and I think commit messages is not the best place for storing decisions and associated context. I personally prefer ADRs.

    • sroussey 2 hours ago

      That’s why you put the comment in the code