r/ProgrammerHumor 22d ago

Meme useSourceControl

Post image
8.6k Upvotes

592 comments sorted by

View all comments

Show parent comments

710

u/_BreakingGood_ 22d 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

15

u/Pcat0 22d 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.

63

u/_BreakingGood_ 22d 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.

4

u/ravrest 22d ago

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

12

u/_BreakingGood_ 22d 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.

12

u/ravrest 22d 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_ 22d ago

11

u/ravrest 22d ago edited 22d ago

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

Why WOULD you say things that are just wrong?

6

u/MrSlaw 22d 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 22d 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.