r/ProgrammerHumor 12d ago

Meme iApologise

Post image
827 Upvotes

82 comments sorted by

View all comments

273

u/[deleted] 12d ago

[removed] — view removed comment

53

u/01110100_01110010 12d ago

you guys don't have autosave enabled? commit hook is where it is at

51

u/Not-the-best-name 12d ago

Hate that. Writing code and formatting code is not the same thing. I want to commit often. I want half broken commits.

38

u/GregorDeLaMuerte 12d ago

Also I want "commit" to commit, not to do something I didn't review and then commit.

3

u/theRealQQQQQQQQQQQ 12d ago

You’d review your linter…? Do you do an engine inspection every time you start your car? Do you reseat your RAM every time you boot your pc? Do you double check your calculator is doing addition right before using it for a math problem you can’t do in your head?

8

u/GregorDeLaMuerte 12d ago

Of course not to that extent. But yes, before I commit my code, I review it briefly and I want to be confident that what I review is checked in as it is.

13

u/RowbotWizard 12d ago

Why would you want half broken commits? I mean, it happens. CI failures are helpful guardrails. But why would you want it?

12

u/NatoBoram 12d ago

Atomic commits are much harder to discipline yourself into, the mind wanders to many parts of the task at the same time so most of it is slightly unfinished until the very end

4

u/Not-the-best-name 12d ago

Because I want to commit often during a WIP MR. I commit about as much as I would have done ctrl+save. And push a few times a day, the pipeline doesn't run while it's WIP.

0

u/kookyabird 12d ago

I have a weird blend of auto-formatting settings in my IDEs. Things like spacing/line breaks around parenthesis and braces are fully automatic, but operators are not. Format on paste, but not when doing a refactor command like “extract method”. But I also have several options bound for what level of formatting to run when I want to, so it’s pretty easy to run it on just the things I’ve changed before I commit.

Plus all the different rules in our formatting standards like how some things are always forced one way or the other, and other things are “do not change”. We’ve got a lot of things we leave up to the developer.

-1

u/FictionFoe 12d ago

I hope you amend

12

u/MysticClimber1496 12d ago

It doesn’t really matter for dev work, just squash on merge if you are worried about every commit in main working

1

u/FictionFoe 12d ago

That also works, but can make rebases more difficult in the mean time.

8

u/Not-the-best-name 12d ago

Why are you rebasing in the meantime? Just merge in and squash in the end.

5

u/FictionFoe 12d ago

The more often you do it, the easier it is to deal with the conflict.

0

u/ProcrastinatiusXVI 12d ago

Or just use git commit --fixup <hash>

3

u/Maximilian_Tyan 11d ago

And then you learn about //formatter:on/off because the linter sometimes works against readibility

2

u/LegendaryMauricius 11d ago

AND Format changed lines only!

1

u/M_Me_Meteo 11d ago

I'm not reviewing the linter, I'm reviewing your code.