this post was submitted on 20 Nov 2024
848 points (97.4% liked)
Programmer Humor
19623 readers
4 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Here is the exact warning that a user had to click through in order to get to where they got:
Hm ok yeah, that seems quite scary sounding so that i would strongly hesitate before clicking on "discard ALL changes". Still, I wonder if a second confirmation dialog with more information is warranted for a command that's so destructive.
I wouldn't assume "discard changes" means "delete files that existed before the editor did".
discarding changes does not discard uncommitted new files. The VS Code button did a
git clean
which is completely unexpected. Git even refers to a git clean with completely different terminology.Note that git clean never once refers to discarding anything, and git reset never refers to removing untracked files. VS Code was doing an idiotic thing. Running
git reset --hard
ANDgit clean
. There is absolutely no reason to be runninggit clean
from an UI button ever. If you want to remove a file you can explicitly remove it.Imagine that the button said "Discard all changes" and then it ran
rm -rf --no-preserve-root /*
. Would that make sense as a button? No. It definitely would not.Which is exactly the situation the dude was in. As a newbie, it's an easy mistake to make. Telling somebody who doesn't know "well, would you look at that, you didn't know!" is not just unhelpful, it's useless and condescending.
Anti Commercial-AI license