this post was submitted on 20 Nov 2024
873 points (97.6% liked)

Programmer Humor

19804 readers
60 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

founded 2 years ago
MODERATORS
873
submitted 3 weeks ago* (last edited 3 weeks ago) by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 144 points 3 weeks ago (17 children)

I feel bad for this kid. That really is a bad warning dialog. Nowhere does it say it's going to delete files. Anyone who thinks that's good design needs a break.

Half the replies are basically "This should be obvious if your past five years of life experience is similar to mine, and if it isn't then get fucked." Just adding insult to injury.

[–] [email protected] 69 points 3 weeks ago (9 children)

I'm not great at English, but "discard all changes" shouldn't ever mean "Delete".

[–] [email protected] 28 points 3 weeks ago (4 children)

In the context of version control it does. Discarding a change that creates a file means deleting the file.

[–] thebestaquaman 15 points 3 weeks ago

If you have set up your staging area for a commit you may want to discard (unstage) changes from the staging area, as opposed to discarding changes in the working directory.

Of course, the difference between the two is obvious if you're using git CLI, but I can easily see someone using a GUI (and that maybe isn't too familiar with git) misunderstanding "discard" as "unstage".

Either way, what happened here indicates that all the files were somehow added to the VC, without having been committed first, or something like that, because git will not let you discard a file that is untracked, because that wouldn't make any sense. The fact that the GUI let this person delete a bunch of files without first committing them to the index is what makes this a terrible design choice, and also what makes the use of the word "discard" misleading.

load more comments (3 replies)
load more comments (7 replies)
load more comments (14 replies)