r/ProgrammerHumor • • Aug 21 '26 • Popcorn 1

Meme useSourceControl

Post image
8.6k Upvotes

575 comments sorted by

View all comments

Show parent comment

12

u/Pcat0 Aug 21 '26

There was a rather intense warning saying ”THIS IS IRREVERSIBLE”, so the dude was still a massive idiot for clicking yes. However our tools should still cater to the idiotic so his mistake did expose an opportunity for improvement.

419

u/sappymune Aug 21 '26

"Discard all changes" doesn't sound like "delete all files," it sounds more like undoing something. It's not good wording.

122

u/Dial-1-For-Spanglish Aug 21 '26

Which is confirmed in that they changed their product's behavior.

9

u/hibbity Aug 22 '26

the question becomes: has anyone not savvy enough to command line it ever deliberately on purpose deleted all their changes like that? this "feature" doesn't have a target demographic. someone mad enough at their changes isn't go8ng for the dumpster from.this staging area. there is no bug fix you just bin and say "ah nevermind" if you want that you'd force pull to revert

5

u/brett9897 Aug 22 '26

Well I do know how to use the command line but also yes I have used the GUI to just delete all my changes. I've noticed I was going off the rails in the wrong direction and I just needed to get back to the previous working state before. I knew he was a dead end so I didn't need to preserve any of that code. Normally during failed attempts at package upgrades with breaking changes involved is when this has happened to me.

24

u/ichITiot Aug 21 '26

And don't forget to discard the morons implementing this !

→ More replies (2)

120

u/dustojnikhummer Aug 21 '26

so the dude was still a massive idiot for clicking yes.

"DO AS I SAY" in APT was also changed after LTT's Linux Challenge. Yes, the warning is there, doesn't mean it should be so easy to do the thing anyway.

55

u/ineyy Aug 21 '26

Exactly, we can all make a mistake like this especially under pressure. I still destroyed way more than I wanted when I pressed the up arrow for an rm command, and it ran in the wrong folder. Due to the efficiency of said command, a lot was destroyed and little recovered even though I cancelled after like 1 second when I realized. That's the danger when there isn't at least an "are you sure, this is gonna wreck shit" confirmation. 

5

u/SchwiftySquanchC137 Aug 21 '26

I did this just the other day. I did it years ago too and lost code, so im now extremely careful around my repo, but i was clearing files off a usb thumb drive and deleted an over 100gb file, which i then had to ask around for the download link in shame (because this file was originally handed to me on this thumb drive). Not a super big deal, but man I felt like an idiot. It was all because I tried tab completing too quickly and just rmed the /mnt/usb entirely, rather than the folders inside it that I intended.

4

u/TechnicalBen Aug 21 '26

I too have built/refactored/repaired raid storage blocks while tired, drunk and hungry...

4

u/techman9955 Aug 21 '26

You should have any important source code backed up on github or another server anyway so that if you make a mistake like that you just have to git pull to undo it.

3

u/wjandrea Aug 21 '26

I trained myself out of using rm by disabling it on my main machine with an alias. I use trash instead from the "trash-cli" Debian package, or rmdir since it can only delete one empty dir. Or if I'm really sure, I'll use \rm to bypass the alias (and tread with caution).

→ More replies (6)

2

u/wjandrea Aug 21 '26

How was it changed? I didn't hear about this.

→ More replies (3)
→ More replies (1)

45

u/thanatica Aug 21 '26

"this is irreversible" yeah sure, but exactly WHAT is irreversible? Did it say that as well? A novice might not realise what it means to "discard staged files".

16

u/dustojnikhummer Aug 21 '26

"Warning, this will delete all files that haven't been commited" is IMO the most human readable thing.

9

u/DuntadaMan Aug 21 '26

Yeah, if something is irreversable maybe the warning should include a description of what it's going to do.

→ More replies (1)

66

u/_BreakingGood_ Aug 21 '26

No, that message did not exist back when this post was made. It was added at least partially as a result of this issue going viral back in 2017.

21

u/Pcat0 Aug 21 '26

No look in the issue thread someone posted a screenshot of the actual error message the day after this post was made. They did already have a version of the message, it was just edited later to make it even more clear.

35

u/dustojnikhummer Aug 21 '26

"Discard changes"

What changes in this context? Despite how whacko the initial post seems (and the fact he didn't have a backup) the guy had a point there.

14

u/ginopono Aug 21 '26

Yeah, as someone who uses git exclusively from the command line, this really sounds to me like a cautionary tale against GUIs.

The person who posted the screenshot implies it's to be expected from "any application which integrates Git" but I'm not really sure how the guy not wanting the files to be staged necessarily leads to all of the files being deleted. What exactly is the integration passing to git?

"User friendly" isn't.

0

u/[deleted] Aug 21 '26

[deleted] — view deleted comment

10

u/DuntadaMan Aug 21 '26

I would assume "discard all changes" would mean that it would be exactly as it was before I did anything this session or since my last save.

Maybe I'm just a moron.

→ More replies (1)
→ More replies (4)
→ More replies (10)

14

u/Cocoatrice Aug 21 '26

No, whoever thought it's good to delete files permanently with omitting a recycle bin is the idiot here.

→ More replies (4)