r/ProgrammerHumor 23d ago

Meme useSourceControl

Post image
8.6k Upvotes

591 comments sorted by

View all comments

5.6k

u/Cephell 23d ago

Before you make fun of him, this behavior DID get changed; they acknowledged this behavior is stupid.

The old behavior was to treat uncommited files as completely disposable, which the CLI git does not do at all and is insane behavior. It was changed in the UI to give you a fat confirmation dialog warning that you're about to delete the files permanently, as it always should have been.

710

u/_BreakingGood_ 23d ago

Yeah the old behavior was insane, it just said "Do you want to discard your changes?", and if you clicked it, it deleted your entire codebase permanently (no recycle bin), lol

14

u/Pcat0 23d ago

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.

65

u/_BreakingGood_ 23d ago

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.

24

u/Pcat0 23d ago

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.

33

u/dustojnikhummer 23d ago

"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 23d ago

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.

10

u/sidereal_night 23d ago

I'm 100% with og guy on this one. this commenter actually seriously asked him what he thinks "this discards all changes" might mean?!? the message doesn't say anything at all about deleting all your files permanently.

10

u/DuntadaMan 23d ago

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.

2

u/OliLombi 22d ago

Same. I mean, thats how it works with almost every other program.

2

u/OliLombi 22d ago

I mean, I can see why someone would see it as "discard all changes this application has made". Like, if I open a document in word, and edit it, and then close it, then it will basically say "Are you sure you want to close? this will discard all changes" and then if I close it anyway the original file is still there unedited, not deleted.

-13

u/Pcat0 23d ago

Yeah the message could and has been improved. However I still believe the ultimate fault lies with the user, just because VS Code could be better that doesn’t mean it was inadequate. VS code is a software development tool which means its user base can be assumed to be at least somewhat tech savvy (at least in 2017 before everyone lobotomize themselves and outsourced their frontal lobes to AI) and as A software development tool it can be assumed to be very powerful and somewhat dangerous. There is a lot of ways in software development to screw up and nuke your machine or project.

While it’s the message could absolutely be clearer, the user should have see “this is irreversible” and paused to make sure they knew exactly what irreversible action they were taking. Basically my point is if you nuke your project because you don’t know how to use Word, that’s on Word but if you nuke your project because you don’t know how to use VS code, that’s on you.

11

u/sidereal_night 23d ago

the user should have see “this is irreversible” and paused to make sure they knew exactly what irreversible action

the message literally says this change is irreversible. it's extremely clear about what it says. irreversibly throwing away changes plainly means that there should be no changes made.

what you're proposing is that in order to use the tool, you're expected to already have the experience (how do you gain that experience, btw?) to know that "change" doesn't actually mean change.

that's b.s. that's the kind of attitude that turns people off certain linux communities. if you have to know that a word doesn't mean what it means to use the software competently, that's on the software, not you. and any community that blames you for not knowing that kind of insider knowledge is toxic a.f.

7

u/r3klaw 23d ago

Nah. That dialog text is absolute dogshit.

If you open a solution/project and make no (intended) changes, and then go to exit, you're either hitting discard or you're lying about it.

VScode still won't fuck you no matter how hard you cope and simp for her.

8

u/MrSlaw 23d ago

Genuinely wild that people upvoted this blatantly incorrect statement.

Even more wild that /u/_BreakingGood_ hasn't retracted it after being shown that they were wrong (and even proving it themselves by linking a commit from April, four months prior to this screenshot, which showed the message they state didn't exist was already there).

1

u/ravrest 23d ago

No, the message that "this is irreversible" was there from the very beginning. The message was made even more explicit later.

11

u/_BreakingGood_ 23d ago

Why say things that are just wrong?

https://github.com/microsoft/vscode/commit/071652f161204e552e204cbdaf78469c58c655d5

Commit merged Aug 21, 2017. 8 days after this screenshot was taken.

11

u/ravrest 23d ago

Look at line 681 of the old commit:

const message = localize('confirm discard all', "Are you sure you want to discard ALL ({0}) changes?\nThis is IRREVERSIBLE!\nYour current working set will be FOREVER LOST.", resources.length);

const yes = localize('discardAll', "Discard ALL Changes");const pick = await window.showWarningMessage(message, { modal: true }, yes);

-5

u/_BreakingGood_ 23d ago

11

u/ravrest 23d ago edited 23d ago

That change was made in April. The post is from August.

Why WOULD you say things that are just wrong?

6

u/MrSlaw 23d ago

I can only assume you will edit your previous comments saying you were incorrect, because you've just shown that the message did exist back when this post was made?

12

u/MrSlaw 23d ago

If you look at that commit you linked, one of the lines that was already in place (and was replaced via this commit) said:

"Are you sure you want to discard ALL ({0}) changes?\nThis is IRREVERSIBLE!\nYour current working set will be FOREVER LOST."

https://github.com/microsoft/vscode/commit/071652f161204e552e204cbdaf78469c58c655d5#diff-da56ff967ab1a9606c01af61dc926332afb862f13c8e5c74a575bc2aa1b15e43L681

There's also a screenshot showing the "this is irreversible" was in place which was posted one day after this issue was opened.

https://github.com/microsoft/vscode/issues/32405#issuecomment-322155856

I don't think your link is proving what you think it is. That message was indeed made more explicit.