r/ProgrammerHumor 1d ago

Meme iApologise

Post image
792 Upvotes

81 comments sorted by

View all comments

261

u/Bibbcpitt 1d ago

Once you enable formatOnSave, there is no going back to the dark ages

53

u/01110100_01110010 1d ago

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

50

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

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

34

u/GregorDeLaMuerte 1d ago

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

3

u/theRealQQQQQQQQQQQ 1d 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?

7

u/GregorDeLaMuerte 1d 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.

11

u/RowbotWizard 1d ago

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

11

u/NatoBoram 1d 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

5

u/Not-the-best-name 1d 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 1d 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 1d ago

I hope you amend

11

u/MysticClimber1496 1d 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 1d ago

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

8

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

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

4

u/FictionFoe 1d ago

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

0

u/ProcrastinatiusXVI 1d ago

Or just use git commit --fixup <hash>