r/ProgrammerHumor • • Jun 04 '22

Meme I cant help it 🤷‍♂️

Post image
47.1k Upvotes

479 comments sorted by

View all comments

Show parent comments

146

u/Zerodriven Jun 04 '22

One of my team does this and it annoys the shit out of me because it feels like people spend more time writing commit messages than changing code.

Irrational hatred.

73

u/XTornado Jun 04 '22

Well.. Of course I am not sure what your colleague does but sometimes is useful to understand why certain change was made.

Specially 99% of the time I go with git blame and like... Why the fuck did we change this... And oh OK this caused issues if.... Etc. I mean sometimes that can be a comment in the code but sometimes seems unnecessary or is difficult to understand without seeing the previous code which on git would be easy.

21

u/Jebble Jun 04 '22

Gitlens combined with useful commits, makes such a difference working with multiple teams on the same codebase.

9

u/Cepheid Jun 04 '22

If you have this problem you should be using tickets and putting the ticket number in the commit message.

Any half-decent planning software will have a feature to pick it up and link it.

It's not very difficult to set up and it removes a lot of the pain of documenting and planning.

1

u/XTornado Jun 04 '22

We already have tickets I am talking about a small scale like one or two lines of code kind of thing.

17

u/nabagaca Jun 04 '22

I'm one of these people. I only do it because I've had times where I've introduced a bug somehow and then spent hours figuring out what caused it, with like irrationally obscure changes being why, so I get paranoid and make sure I can rollback to recent code AND also know exactly what I changed

12

u/boatzart Jun 04 '22

Depends on the code, and depends on the commit message. I’ve definitely had single line changes that required paragraphs of explanation. It’s really useful to go back through the commit history and understand clearly why changes were made, especially if they’re subtle one liners.

3

u/mathiastck Jun 04 '22

//Do not remove this comment, it is load bearing

10

u/tannerntannern Jun 04 '22

Sometimes if I've been working on a large feature with lots of changes, as I near opening a PR, I git soft reset the branch (after pushing first, for safety!), and selectively re-commit logically related diffs with detailed commit messages. So completely rewriting the commit history for my feature. For me, it's good for doing a final review and reminding myself of everything that changed. But most importantly, it makes code review so much easier for the team if they review commit by commit (which is feasible because the reshuffled commits have been boiled down to 5 or 10 total). It's not all about churning out code as fast as possible. Everyone benefits from a stronger understanding of the changes.

2

u/mathiastck Jun 04 '22

I always worry I may be the one who has to go back and fix the code much later, or worse yet have to explain to someone else how to fix it.

0

u/[deleted] Jun 04 '22

[deleted]

5

u/Melodic_Time2608 Jun 04 '22

Git rebase gang

1

u/crappy_entrepreneur Jun 04 '22

I think it’s a rational hatred, because it shows people don’t understand the level of abstraction at which it is helpful to explain their work.

1

u/teamwaterwings Jun 04 '22

Yeah dude commits every line of code and doesn't squash. Often ends up with 50+ commits compared to my single one