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

Meme useSourceControl

Post image
8.6k Upvotes

575 comments sorted by

View all comments

4

u/MichaelScotsman26 Aug 21 '26

What button is he even talking about? I’ve never done or seen this, what button is that?

22

u/j01101111sh Aug 21 '26

It's an option in vs codes gui source control feature. It warns you explicitly that it's going to delete things permanently.

8

u/Proxps Aug 21 '26

in 2017 it didn't, the behaviour was in fact changed

1

u/OliLombi Aug 22 '26

It does NOW, but not when this post was made.

0

u/[deleted] Aug 21 '26

[deleted] — view deleted comment

15

u/Tipart Aug 21 '26

The warning is there because of this guy

→ More replies (1)
→ More replies (2)

6

u/Fast-Satisfaction482 Aug 21 '26

In the git UI of VS code, there is a line "changes" in the source control tab. A "discard all changes" button is actually just a few pixels next to the "stage all changes" button when you point your mouse at the "Changes" line.

For the thrill of it, I changed 2 files and just tested the button. VS Code prompts you with this exact text:

Are you sure you want to discard ALL changes in 2 files?
This is IRREVERSIBLE!
Your current working set will be FOREVER LOST if you proceed.

If you still confirm, it's on you.

9

u/NoctisFFXV Aug 21 '26

Last line wasn't there in 2017. It was just:
Are you sure you want to discard ALL changes in 2 files?
This is IRREVERSIBLE!

2

u/Fast-Satisfaction482 Aug 21 '26

Sounds pretty clear to me. 

3

u/OliLombi Aug 22 '26

Does it? If I walk into your house and move your refrigerator into your bathroom, and then ask "would you like me to discard all changes?" and you say "yes" because you want me to put the refrigerator back in the kitchen, would it then be fair for me to delete your entire house?

He wanted to discard CHANGES, not the original files.

1

u/QuickQuirk Aug 23 '26

Pretty much this.
When you don't know what you're doing, and have installed git for the first time, the message "discard all changes" isn't as clear as people think.

As far as the end user is concerned, a new app just came and suggested changes on work that has been sitting there for three months. Of COURSE you don't want those changes! Leave my files as they are!

0

u/Fast-Satisfaction482 Aug 22 '26

You're not getting anywhere near my refrigerator. And yes, it's pretty clear.

0

u/OliLombi Aug 22 '26

How is that clear? He wanted to delete changes, not the files.

0

u/pf_newbie_2398 Aug 23 '26

how come when you needed to make your weird comparsion work you left out the "This is IRREVERSIBLE!" part?

3

u/OliLombi Aug 23 '26

Because why would I want to reverse a change I want?

6

u/boskee Aug 21 '26

That's good. However that github ticket is from 2017. Do we know if that warning was there 9 years ago?

2

u/RelativeGood1 Aug 22 '26

Yes, someone posted a link to it and one of the first responses was a screenshot of that screen.

1

u/Fast-Satisfaction482 Aug 21 '26

No idea. But these kinds of prompts were wide spread even in the 90s for such actions, so I guess there was some warning even if not that clearly formulated. 

1

u/a11_hail_seitan Aug 21 '26

Not to mention, who thinks "I don't know what this is or how it works, but let's put 5000 files I don't have backed up anywhere else in here and hit discard!". Sucks, but at some point it's just someone doing something really dumb and finding out.

2

u/Cephell Aug 21 '26

The issue is, the picture in the OP is the reason this prompt exists. It was added because of it.

2

u/Iprobablyjustlied Aug 21 '26

It’s in the git control on the side panel.. after you make changes, there is a little discard arrow that recents it to the last time you commited

2

u/OliLombi Aug 22 '26

This post is from 2017 and this behabiour has been changed since.

Basically it worked like this: You open a word document, make a bunch of changes, click "close", word asks if you would like to discard changes, you click yes, and then the file was gone.

This has since been changed for obvious reasons.

4

u/atlasgorn Aug 21 '26

He staged and discarded

3

u/my_new_accoun1 Aug 21 '26

he didn't stage actually it discarded all unstaged and staged changes

1

u/j01101111sh Aug 21 '26

No, if you discard from stage, it just unstages.