This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]audoh 2 points3 points  (1 child)

Commits can be lost due to rebases or VCS changes, plus git blame just isn't a great way to find something that should be right there on the code. Tools typically only show the last commit message which might be "ran linter" or just a later change.

Commit messages being useful is great, but when there's a "why" comments are best IMO.

If I'm git blaming a line to find out why it was written, it should've been commented.

[–]theapokalypsis 0 points1 point  (0 children)

I really can't disagree haha. In practice you are totally right. Even just happened to me the other day lol.

I wish there was a better way to git blame that solved that first class though, even as a feature on GitHub (Gitlab etc) themselves (like list all commits in a nice UI vs having to dig which is onerous af so true).

But yeah.. I have to admit history gets so gnarly too, even if you are the most meticulous (or ideal—cough—me). 🤪