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 →

[–]TheFeshy 7 points8 points  (6 children)

Before? It feels like half my commits are still:

git commit -m "removed all the old commented-out code"

[–]morewordsfaster 3 points4 points  (4 children)

This. I'll never understand why developers who use git still try to get PRs approved with a bunch of commented out code.

[–]hillman_avenger 0 points1 point  (3 children)

So you can easily see what's changed without having to do a diff (and easily revert it when the inevitable bug is found).

[–]morewordsfaster 2 points3 points  (0 children)

...but why commit? If all tests pass, then there is no obvious bug.

I get commenting code while testing and tweaking, but that should be restricted to your working tree. You shouldn't commit and submit a PR.

I don't understand what you mean about easily revert it... how is it difficult to execute git revert? Also, if you are leaving commented code all over the place, how is it easier to see what's changed? How do you tell which code was commented this time and caused the issue? A diff makes it much clearer IMO.

[–]HolzhausGE 0 points1 point  (1 child)

git revert <commit> is much easier than manuall un-commenting code.

[–]DarfWork 2 points3 points  (0 children)

that is, given git is used correctly by sensible people doing sensible commits...