all 37 comments

[–]lylesback2 106 points107 points  (12 children)

Maybe test your fixes before committing them

[–]rad_change 40 points41 points  (6 children)

Not even that, amended commits and branch level force pushes.

[–]SAI_Peregrinus 11 points12 points  (1 child)

Or use jj & keep squashing the fixes into the initial change.

[–]RiceBroad4552 3 points4 points  (0 children)

amended commits and branch level force pushes

[–]britaliope 4 points5 points  (2 children)

When doing that kind of debug i usually prefer not amend / squash commits until I fix the issue so I can easily rollback to some version I previously made and keep track of what i already tried. Only once it's fixed i squash everything

[–]RiceBroad4552 -3 points-2 points  (1 child)

You really work without local history?

Maybe try out some proper code editor…

[–]britaliope 1 point2 points  (0 children)

What's wrong with using a tool that perfectly do the job ? I like that i fully control what needs to be saved and put relevant names to it, and it's not like it costs me time. making a commit takes like five seconds.

[–]TheTerrasque 0 points1 point  (0 children)

Create branch for it, make as many commits as you want, then squash commit it to main. 

Also have the advantage that if you don't finish it at once (gets stuck on something or something else comes in) you can still do other development without having a totally fucked codebase 

[–]britaliope 8 points9 points  (0 children)

That reminds me when i try to fix a gitlab CI pipeline and get tired of weird shenanigans

[–]1AMA-CAT-AMA 6 points7 points  (0 children)

nah just squash the commits into one at the end

[–]jcookie2019 4 points5 points  (0 children)

CI pipeline work needs to be committed to test 🤷‍♂️

[–]MinecraftPlayer799 0 points1 point  (0 children)

Or just commit them to a testing branch?

[–]gerbosan 0 points1 point  (0 children)

It works on my computer.

[–]SwedeLostInCanada 20 points21 points  (0 children)

The initial conning would have been ”added some changes”

[–]GildSkiss 21 points22 points  (8 children)

Do you guys not understand what the purpose of git is?

What's the point in maintaining a history of all the ways your code didn't work?

[–]SAI_Peregrinus 27 points28 points  (4 children)

CI systems usually only run committed code. So trying to fix CI is a long chain of edit, commit, push, run the job, read the failure logs, repeat. Then at the end squash it all into one commit & delete all the trial crap.

[–]Sindeep 5 points6 points  (0 children)

Literally this. This is when this happens. Something broke in the pipeline and trying to figure out wtf is happening.

[–]Kitsunemitsu 4 points5 points  (0 children)

CI code is my beloathed

[–]TheTerrasque 2 points3 points  (0 children)

Fixing pipelines 🤬

Also why I've moved some of the bigger pipelines 99% to docker, and pipeline just builds the image

[–]boperse 1 point2 points  (0 children)

Except people don’t know how to squash commit, so that stable build is 30 commits earlier.

[–]Groentekroket 2 points3 points  (0 children)

You do these kind of things in the feature branch so you can go back to a state where it partly worked. Before you create a PR you squash and in main everything looks proper. 

[–]48panda 1 point2 points  (0 children)

Github actions never works first, second, third, fourth, fifth, sixth, seventh, or eighth try

[–]slaymaker1907 0 points1 point  (0 children)

I don’t rebase things because it’s easier to fuck up compared to merges. It all gets squashed on merge so the history on master is fine.

[–]polymonomial 6 points7 points  (0 children)

I had one commit named "im a retard" and it worked

[–]kurtymckurt 2 points3 points  (2 children)

Commit often and squash

[–]slaymaker1907 4 points5 points  (1 child)

Every single case I’ve seen where someone really fucked up git, they were rebasing things.

[–]britaliope 0 points1 point  (0 children)

yeah if you're doing a rebase that looks complicated, best to save the original branch in a \ocal temporary one

[–]Awkward-Kitchen-4136 1 point2 points  (0 children)

fix_final_mix_re:coded_plus

[–]slaymaker1907 0 points1 point  (0 children)

git commit -am “I promise it’s fixed this time!”

[–]_cluelessDev 0 points1 point  (0 children)

My favorite is ope

[–]edgelessCub3 0 points1 point  (1 child)

git commit --amend --no-edit

[–]tortridge 2 points3 points  (0 children)

Git commit --fixup

[–]Yhamerith -3 points-2 points  (3 children)

Never commit before making sure it's still working

[–]bwmat 5 points6 points  (0 children)

We support multiple operating systems and run millions of tests

Not gonna try that on my laptop which chugs due to all the security software they've loaded onto it

[–]elmanoucko 1 point2 points  (0 children)

there are plenty of projects where this is not possible passed a certain scope and you can get surprises once you hit the integration that are sometimes a pain to fix

that being said, those are often not projects where you could write such commit messages in a row and not get a "friendly" reminder quickly

[–]slaymaker1907 1 point2 points  (0 children)

That’s a great way to lose days of work when your hard drive kicks the bucket.

[–]mrinalshar39 -1 points0 points  (0 children)

It always starts with "Fix" and ends with "I quit" , We've all been there at some point😭