Hacker News new | ask | show | jobs
by josephg 1082 days ago
Relying on commits also fails as soon as feature branches start being squashed. And the comments in commits can’t be modified over time. You have to hope readers “git blame” the correct lines of your code.

Just use comments.

1 comments

Don't squash. If you insist on it, I can't imagine why you wouldn't squash the commit messages

You're not supposed to change commit messages.

The correct lines to blame are the ones right there, not exactly rocket science

If your git squash contains all the commit messages, it’s a pain to figure out which commit message refers to which line of code.

A comment goes right there. No tools needed. Mutable. Readable. Contextually in place. And you can even add comments while coding without waiting for the commit.

Is typing // really so much effort?

No it's not and neither is writing a proper commit message. That's why you do both, but most of it goes in the commit. Like in the Git project