4 ms·
I don’t think this is a good rule. 1) I can’t see “git blame” in my code review. Don’t make me check out the branch to review your changes. 2) If we refactor
by theptip 5y ago
I don’t think this is a good rule.
1) I can’t see “git blame” in my code review. Don’t make me check out the branch to review your changes.
2) If we refactor the code (say, extract a new class wrapping the functionality) then the explanation in git becomes much harder to find. If it’s a comment you can just copy it over.
You should explain the change set in your git comments too, but at a different level of abstraction - why is this whole set of changes being made? What problem is being solved? What’s left to do? Etc. this stuff can’t usually be associated with a particular line of code.
So inasmuch as you are arguing for good commit messages I strongly agree. But I disagree that this should be at the expense of good comments in your code.
- xixixao 5y ago> code review You shouldn’t need this. The commit message should clearly explain any non-obvious changes (and ideally there should only be one). If there is a historical context, the reviewed commit message should include it (including links to past commits in whatever repo hosting service is used). > refactor If there is a refactor the reader can skip past the change in blame. This does become slightly more complicated when code is moved between files, but most repo hosting services make this fairly easy.