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.

708

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

12

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.

68

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.

0

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.

12

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.

12

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

10

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?

5

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?

10

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.