Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

--message "wip"

Why do we care about commit messages? I only read them when rebasing.



They are incredibly helpful when you are trying to find where a bug was introduced, and trying to figure out why some piece of code is the way it is.


If you can’t figure it out based on the git blame and git diff, the code is incredibly unreadable. A comment in the code, or simply writing better readable code seems like a better investment.

Besides, a few passes refactoring and your git history is ruined. No way you’ll find the original commit within any reasonable time frame.

If I move the code to another function, your original commit message will be hard to trace. If the code was commented, the comment would have been moved along. If the code was readable, you don’t need the comment or the commit message.


I can only speak from my own experiences, but I have found commit messages extremely helpful, when they explain the "why" of the change. And as unfortunate as it is, many of us also have to work with unreadable codebases.


It's useful in case like if you ever need to fill out a PR template with what you did or list the changes, it becomes so much easier. You don’t even have to remember exactly what was changed it’s all right there in the commit message.

With structured comments, you can even use the AI to fill out the PR template easily and precisely.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: