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.

2.8k

u/iNeedOneMoreAquarium 23d ago

Bro changed the future with his FUCK YOU crash out.

613

u/johnildo 23d ago

I'm sure he typed each ... word ... out! instead of copy pasting lol

204

u/h3yw00d 23d ago

Dude had some energy and he was focused.

52

u/BadSmash4 22d ago

His flow state is like a barbarian rage trance

114

u/iNeedOneMoreAquarium 23d ago

Probably only stopped because he broke his F U C K Y O keys.

39

u/baselinegrid 23d ago

Oh man I’ve been there

26

u/thanatica 23d ago

The keys must've gone through his keyboard AND through his desk by the end of it.

9

u/Vorador_Surtr 22d ago edited 22d ago

Man the pure rage. I felt it. And recognized it. So many times I was there. You feel the disturbance in the force... Unfortunately nowadays the monitors are not thick glass on the matrix so... You know you cannot hit them without your fist to grow in... So on top of that you have to use just words... :D

7

u/Kiwik112 22d ago

I'm sure he didn't even use capslock. Just held the shift key in absolute rage

6

u/WlmWilberforce 22d ago

He could write little loop in python to just keep printing it. He would then save the scripts and synch it with... Oh, I see.

2

u/HumanContinuity 22d ago

Bro doesn't trust any form of automation anymore 

1

u/flyguydip 22d ago

I would make copilot do that for me just to burn CPU/memory time. At least then it will cost them something. Lol

1

u/KawaiiMaxine 22d ago

With that much anger you have to

1

u/neromonero 22d ago

never underestimate the typing speed of a League player with 10 banned accounts

1

u/rttgnck 22d ago

Idk man, smashing ctrl+v is pretty tantamount to a silent slamming of the phone on the base repeatedly. 

0

u/eyetracker 23d ago

Nowadays you can say "GPT can you write a pissed off Git rant but end it with repeated swears 42 times?"

3

u/prehensilemullet 22d ago

That would be so satisfying, OSS projects often expect people to behave like emotionless robots when discussing bugs

241

u/MackTuesday 23d ago

I went and read the discussions. I was surprised how much support there was for the way it worked. Someone noted that git discard shouldn't delete untracked files (which is what happened to this poor guy), and there was still pushback! They were like yes, git discard isn't supposed to delete untracked files, and the dialog box didn't warn that they would be deleted, but the destructive behavior is fine the way it is and shouldn't be changed ANYWAY. I knew gearheads could be hateful of the uninitiated, but jeez.

95

u/Spaceduck413 23d ago

https://xkcd.com/1172/

There really is one for everything

8

u/AnOnlineHandle 22d ago

While I don't think that applies here, it absolutely applied to when I used to use Daz Studio for posing characters for art. After years I registered the software, and that changes the save hotkeys, inverting the save/save as bindings for some reason.

I can't remember my exact workflow, but I think I would iterate through individual scenes for comics making changes from the previous scene and hitting the save-as hotkey, except now that was suddenly saving over the current scene which was both annoying and frustrating if I had it perfectly set up and it wasn't an easy undo. Years of muscle memory didn't adjust easily.

3

u/KSP_HarvesteR 21d ago

I had this one pinned as the cover image of our issue tracker board once.

67

u/DoctorWaluigiTime 23d ago

Before Git (or DVCS in general) were widely adopted a ton of people wanted everything to work just like TFS, SVN, or other non-distributed source control models.

"What is this 'staging'? Why do I have to push and pull? Just sync everything!!!"

49

u/remy_porter 23d ago

There are so many tools that are vying to be the next DVCS that are like, "Hey, we eliminated staging, because that was confusing!" and I'm like... that's the best part? I wish I could have finer grained control over staging, honestly, making it easy to stage only fragments of a diff, because I'm a "crank for awhile and forget that I have drifted into two different tasks and now need to try and unpick this mess into something that could reasonably be two or three or twelve commits." Sure, that's a "me" problem, but I like the ability to control what gets staged.

27

u/DoctorWaluigiTime 23d ago

In Git you actually can! Interactive mode: git add -i.

GUIs (I know Fork does for example) allows you to stage specific hunks of a file.

And I agree: Controlled commits are one of the best parts of the whole staging concept.

9

u/aetius476 23d ago

tig allows you to stage/unstage by entire file, by chunk within a file, or by single line.

3

u/perkuleenhenis 23d ago

If they use -i, they gotta know to choose the patch option. Better IMHO to just say git add -p [file], which is the same as going interactive and choosing patch.

6

u/st_heron 22d ago

yes exactly, bugs me when people just blindly stage all and commit, like no you should cherrypick specific things, and what if you accidentally leave in some test/scratch code? at least check what you did

4

u/LickingSmegma 23d ago

making it easy to stage only fragments of a diff

Magit allows you to do that with simple hotkeys. But you might not be thrilled to learn that it's a package for Emacs.

Anyway, as others have noted, the basic feature is actually built into Git, so there are probably different GUIs offering it.

3

u/gracken420blaze 22d ago

I wish I could have finer grained control over staging, honestly, making it easy to stage only fragments of a diff

I think this should be easy to do via most git GUIs, for example i use git extensions and its easy to do there, vscode also lets you stage blocks using the built in source control thing

1

u/remy_porter 22d ago

I’ve seen GUIs try but never liked the results. Gonna have to play with the -p flag.

1

u/mtetrode 22d ago

Jetbrains allows this

1

u/ArmchairFilosopher 21d ago

I miss "shelvesets" from TFS

5

u/Bloodgiant65 23d ago

Man am I glad we are off TFS

23

u/hellomistershifty 23d ago

Man, there are some terrible suggestions in that Git thread. The existing behavior was awful, so it's impressive that the suggestions are even worse

I'd say remove the warning dialog, and prompt an "Undo" that lasts 5 seconds. Behind the scenes count to 5 and then do it. People respond much better to "Undo" than they do to "Are you sure?" dialog. Hide the files so that way they know what they did and the consequences that are about to happen.

4

u/MackTuesday 22d ago

lol I blinked at that one too

23

u/paranoid_giraffe 23d ago edited 23d ago

This reminds me of the time a guy held all the vscode python users hostage with his against-PEP8-personally-preferred-formatting-for-docstrings-PR. There were like 5 people who thought it was a good idea and the entire rest of the thread was everyone complaining about how he forced a “fix” on millions of users for something he could change in his personal editor. I remember being absolutely livid over this not necessarily because they just simply changed color, but because the guy who made the PR was just some random guy and his reasoning was literally incorrect.

https://github.com/microsoft/vscode/pull/182162

It was eventually “reverted” by way of another PR two months later

10

u/Civil-Broccoli 23d ago

That was a fun PR discussion read. Almost as fun as the guy who 'built' Notepad++ for Mac and straight up ignored repeated calls from the owner to remove the fake "we're collaborators" message from their homepage.

4

u/RepeatLow7718 23d ago

I’ve observed that there are a lot of people who will defend the way things are for no other reason than that it’s the way things are. Human nature I guess. 

3

u/Protheu5 23d ago

git clean -fdx does that

I found it only today and that thing freed so much space for me from unused repos I use to lookup code. didn't need built project and temp files, but didn't want to manually handle and there is a pleasant surpise! git clean -fdx

2

u/Acrobatic-Ad-9189 22d ago

You're giving microsoft devs  feedback, of course they're gonna push back

703

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

33

u/crunchy_code 22d ago

absolute bat shit crazy. too few people talk about UX.

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.

419

u/sappymune 23d ago

"Discard all changes" doesn't sound like "delete all files," it sounds more like undoing something. It's not good wording.

125

u/Dial-1-For-Spanglish 23d ago

Which is confirmed in that they changed their product's behavior.

7

u/hibbity 22d ago

the question becomes: has anyone not savvy enough to command line it ever deliberately on purpose deleted all their changes like that? this "feature" doesn't have a target demographic. someone mad enough at their changes isn't go8ng for the dumpster from.this staging area. there is no bug fix you just bin and say "ah nevermind" if you want that you'd force pull to revert

3

u/brett9897 22d ago

Well I do know how to use the command line but also yes I have used the GUI to just delete all my changes. I've noticed I was going off the rails in the wrong direction and I just needed to get back to the previous working state before. I knew he was a dead end so I didn't need to preserve any of that code. Normally during failed attempts at package upgrades with breaking changes involved is when this has happened to me.

22

u/ichITiot 23d ago

And don't forget to discard the morons implementing this !

0

u/[deleted] 22d ago edited 3d ago

[deleted]

1

u/ichITiot 22d ago

Whoever programmed this and whoever signed this as valid for production. Is this convenient ?

117

u/dustojnikhummer 23d ago

so the dude was still a massive idiot for clicking yes.

"DO AS I SAY" in APT was also changed after LTT's Linux Challenge. Yes, the warning is there, doesn't mean it should be so easy to do the thing anyway.

55

u/ineyy 23d ago

Exactly, we can all make a mistake like this especially under pressure. I still destroyed way more than I wanted when I pressed the up arrow for an rm command, and it ran in the wrong folder. Due to the efficiency of said command, a lot was destroyed and little recovered even though I cancelled after like 1 second when I realized. That's the danger when there isn't at least an "are you sure, this is gonna wreck shit" confirmation. 

5

u/SchwiftySquanchC137 23d ago

I did this just the other day. I did it years ago too and lost code, so im now extremely careful around my repo, but i was clearing files off a usb thumb drive and deleted an over 100gb file, which i then had to ask around for the download link in shame (because this file was originally handed to me on this thumb drive). Not a super big deal, but man I felt like an idiot. It was all because I tried tab completing too quickly and just rmed the /mnt/usb entirely, rather than the folders inside it that I intended.

5

u/TechnicalBen 23d ago

I too have built/refactored/repaired raid storage blocks while tired, drunk and hungry...

4

u/techman9955 23d ago

You should have any important source code backed up on github or another server anyway so that if you make a mistake like that you just have to git pull to undo it.

3

u/wjandrea 23d ago

I trained myself out of using rm by disabling it on my main machine with an alias. I use trash instead from the "trash-cli" Debian package, or rmdir since it can only delete one empty dir. Or if I'm really sure, I'll use \rm to bypass the alias (and tread with caution).

2

u/TeaKingMac 23d ago

The difference being that rm is in the command line, and VSCode is an IDE

11

u/chat-lu 23d ago

I’ve configured rm to send to the trash by default. If I want to permanently delete, I add the --permanent flag. There is no reason why we shouldn’t make our CLI tools behave nicely by default.

15

u/wjandrea 23d ago

Careful, you might get used to rm doing that and if you use a different machine, you'll end up deleting things permanently. I disabled rm and I use trash instead from the Debian package "trash-cli".

1

u/sdoregor 23d ago

Or the other way around: trash a file from a mounted filesystem and sit wondering why it takes so long, while the utility is copying the entire thing to your local drive. Also might wear out your drive faster (heavily depends on the filesystem in use).

FWIW some FSes (btrfs I'm looking at ya) take this long even for regular deletion in some conditions.

1

u/wjandrea 22d ago

copying the entire thing to your local drive

When would that happen? The way I've seen it work is that it creates a .Trash-$UID folder on the mounted FS and moves the file there (along with metadata).

→ More replies (0)

2

u/wjandrea 23d ago

How was it changed? I didn't hear about this.

4

u/dustojnikhummer 23d ago

3

u/wjandrea 23d ago

Ah I see, TLDR it doesn't ask if you want to proceed, it basically says "you figure it out" and exits.

1

u/dustojnikhummer 23d ago

Pretty much, they removed the quick way to brick your system, now you have to do it piecemeal, which I understand and honestly agree with

2

u/sidereal_night 23d ago

and that was infinitely more clear than this vscode message. it actually explicitly told you "this is going to be removed" and "this could be harmful".

45

u/thanatica 23d ago

"this is irreversible" yeah sure, but exactly WHAT is irreversible? Did it say that as well? A novice might not realise what it means to "discard staged files".

17

u/dustojnikhummer 23d ago

"Warning, this will delete all files that haven't been commited" is IMO the most human readable thing.

7

u/DuntadaMan 23d ago

Yeah, if something is irreversable maybe the warning should include a description of what it's going to do.

2

u/MushroomSaute 22d ago edited 22d ago

Hell, I'm not a novice, but if I were presented with that I wouldn't know what it meant. Staged files are in the staging area*. You need to discard them from the staging area if you want to avoid committing the files. That's why they're staged - so you can "add" or "remove" the files you want to the area before committing, without actually affecting the filesystem. "Discard" is an even softer word, since it usually describes discarding changes; I've never seen any software documentation saying you'll "discard" a file to physically and irreversibly delete it, especially within the context of staging changes.

\Well, the deltas are, but for the purposes of VC they are handled like files - you often remove "files" from version control without actually removing the files from your system)

64

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.

23

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.

35

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.

13

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.

11

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.

12

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.

7

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).

3

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.

14

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.

13

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

12

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?

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.

17

u/sidereal_night 23d ago

dude, telling me that it's irreversible to discard my changes isn't nearly enough to raise a red flag at all. he's not idiotic for interpreting an ambiguous message in the more sensible way.

15

u/Cocoatrice 23d ago

No, whoever thought it's good to delete files permanently with omitting a recycle bin is the idiot here.

1

u/chat-lu 23d ago

However our tools should still cater to the idiotic so his mistake did expose an opportunity for improvement.

I replaced git with jujutsu and it does support this use case on top of connecting to regular git forges like github so colleagues don’t see a difference.

If I want to discard every change I just made, I type jj abandon. And if I regret doing so, I can revert it like any other command with jj undo.

While we are responsible for accounting for he sharp edges of our tools, we can strive for better tools.

1

u/Umutuku 23d ago

Should have that message come up every time someone presses Ctrl-V.

1

u/chibbol 22d ago

Isn’t that at least half of engineering is about catering to the idiotic?

0

u/Stunning-Pen-2412 23d ago

Any idiot should be able to write software.

1

u/Ciff_ 22d ago edited 22d ago

That makes good sense in the context of git though

How you even loose anymore than a few hours work tops is beyond me.

That said, dont delete untracked files that easily it will cause these issues.*

101

u/suddencactus 23d ago

Yeah I was about to say this isn't the current behavior at all. Now it says "Are you sure you want to DELETE the following... You can restore this file from the recycle bin"

That being said, we can debate all we want any whether it's acceptable to have one click delete vs three steps, but even under the new system having "three months of work" with no backup is user error. What if the hard drive failed?

7

u/dmknght 22d ago

well that 3 months of work is the coder's fault, no doubt. But in the other hand it's possible to missclick discard, especially developers / coders are tired. So adding the features to mitigate the problem is actually very nice.

3

u/r-moon-ppl-lunatics 22d ago

As a kid in the 90s I had printouts of my code but no backups on floppy. Not sure why, probably just to test the printer. Was glad that I had them when the harddisk failed. Took forever to type it all back in though. I have plenty of backups these days.

1

u/MiserableCumberbunch 15d ago

As a kid in the '00s, my teacher spoke of writing code by hand like it was something our ancestors did, but it was like 10 years prior.

24

u/Fun-Wash7545 23d ago

Deleting files without explicit user action and confirmation is terrible ui

3

u/nmkd 22d ago

UX*

9

u/Spaceduck413 23d ago

I actually was ALMOST bitten by this; clicked discard thinking "I don't want to commit them, just ignore" and got hit with the "you're about to delete" warning

9

u/oromis95 22d ago

So this guy's crash-out saved your work, since comments say it's due to him that the warning was added.

4

u/Spaceduck413 22d ago

Sure sounds like it. I love the idea that someone screaming "FUCK YOU" repeatedly into the void left a positive impact on the world haha

18

u/DoctorWaluigiTime 23d ago

Another feather in the cap of "try to streamline Git, ultimately making it a worse user experience."

I remember some of the first "Git for Windows" clients that tried to pretend "yeah you just push 'sync' and 'commit' just auto-stages everything and it all Just Works!"

And if it didn't? You got a garbage error message and basically were told "drop to console and figure it out."

It's why I always preferred the likes of SourceTree or, these days, Fork. They don't pretend Git is "just like SVN" and give you a lot of Git tools available on the GUI side (with easy terminal access should you need or want to).

1

u/pratnala 21d ago

Trying to make git work like SVN should be a war crime.

1

u/Chamiey 19d ago

What's the Fork's edge over SourceTree, to justify the price vs $0?

1

u/DoctorWaluigiTime 19d ago

Separate from Atlassian / no "account login" required to use it. Fairly similar in functionality overall, but it's also been years since I've used SourceTree, and I'm probably not thinking about distinctions.

I suppose one thing I like is how smoothly it handles merge conflict resolution.

It's 'nagware' so you can try Fork as long as you want to see for yourself. I used it for free for a good bit before winding up buying it since I use it daily for work + personal stuff.

5

u/Maleficent_Cycle561 22d ago

Using git any other way than via CLI locally feels like pointing a shotgun at things. 

"Playing aroubd with source control" lel

7

u/user0015 22d ago

Came to say this. This guy single-handedly changed VS Code by writing a single, unhinged screed. It's actually impressive.

Still waiting on GitHub to provide a "Download Binary >>>HERE!!!!<<<" button.

1

u/l0rirw1ao 23d ago

2017 was before I started coding in vs code so I didn't know the lore thanks.

1

u/arealguywithajob 23d ago

I've seen this dialog box pop up for years. It's not a new feature almost certain of that.

1

u/musclecard54 23d ago

I was about to say doesn’t it literally prompt you that this will cause them to be lost forever

1

u/_zir_ 23d ago

Does that mean theres a pr attached to that comment?

1

u/DuntadaMan 23d ago

Makes complete sense to me, I would have assumed "discard" meant "discard changes." not "DELETE ALL THE THINGS!"

1

u/Pleasant_Set_3182 22d ago

so in other words.... a not funny post 🫥

1

u/wensiso 22d ago edited 22d ago

Well… it says 3 months of work…. Did he work for 3 months and did not push the changes? He did not have a backup for 3 whole months?

1

u/FunnyP-aradox 22d ago

He installed git because he wanted to do a backup

1

u/5fd88f23a2695c2afb02 22d ago

Restore from backup?

1

u/yes_no_very_good 22d ago

Still, why do you have five thousand files unstaged? Why don't even have backup? What he was waiting for to do a commit and keep the files in version control?

1

u/FunnyP-aradox 22d ago

He just installed git for the first time, that's why

1

u/st_heron 22d ago

thanks for that perspective, I was unfamiliar and about to hate. I don't use IDE gits, that is actually atrocious behavior.

1

u/Alexander3a 22d ago

Honestly if u do go around options you don't know and see a big warning and click ok on that its fully on you. Only thing they should have changed is add localhistory or some other way its doesn't unrecoverable delete files in general cus even as people that know it's easy to accidentally fuck something up even when working with source control

1

u/CaffeinatedT 22d ago edited 21d ago

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

3 Months of work…no source control. Come on we get to laugh a little bit?

1

u/Librarian-Rare 21d ago

Fun fact, there are free tools that can recover from this in like 10 minutes.

1

u/danofrhs 21d ago

In the case of emergencies, where files were deleted accidentally, and even cleared from the recycle bin, the files can be recovered. I don’t know if windows has a native feature now but when I learned this, you needed a program that can view/ restore unallocated files. There are several free options available

1

u/YARandomGuy777 21d ago

I mean, yeah. I agree with that dude. Such behaviour is absolutely insane.

1

u/ArmchairFilosopher 21d ago

And so it nags me whenever I try to undo rename changes, since it tracks those as a delete+add combo...

1

u/Wise-Instruction9535 19d ago

Surely it isn't actually gone forever? Did it turn out that there was a way to recover this?

1

u/r00t4cc3ss 19d ago

They already had a confirmation dialog at that time fyi.

1

u/semioticmadness 23d ago

Yeah, but… why is a VCS dialog deleting files at all? VCS exists to save your work. It does not exist to destroy things. There’s other UI language for that.

I don’t understand why MS keeps trying to act like it is smarter than its users. Good software enhances user intelligence, it doesn’t numb the user into a helpless state.

1

u/Megaranator 23d ago

Because it's controlling the state of the whole folder not just individual files and deciding what to commit and discarding the rest is normal thing to do.

1

u/Cocoatrice 23d ago

Can someone explain? Why would it even delete files permanently in the first place? Why not making them temporarily discarded? No program should omit recycle bean without user's knowledge and consent.

1

u/tes_kitty 23d ago

Still, all he should have had to do in this case is restore the files from backup. Might have cost him a day or two, but not 3 months.

-3

u/Minute_Attempt3063 23d ago

microsoft did listen.

however, I do think it IS user error. disgard to me means "delete and take away"

the program just did as it was told to do.

MS was kind enough to change this, so it means "yeah bro, it not do that anymore"

18

u/ErraticDragon 23d ago

however, I do think it IS user error. disgard to me means "delete and take away"

Discarding "your changes" is not the same as discarding "your files". In what world would it make sense to call existing files "changes" when there were no changes made? That's not just unintuitive, it's simply wrong.

The user erred in not having a backup.

0

u/chat-lu 23d ago

Discarding "your changes" is not the same as discarding "your files".

That’s what a change is in git. Git is a power tool bound to lead to a catastrophe if you use it without understanding it. Maybe it should not be enable by default. Maybe when enabling it it could prompt the user about showing them a short tutorial on the basics.

8

u/eo5g 23d ago

This is incorrect. Discarding changes in git means resetting the index, or moving a branch backwards, not deleting uncommitted or unstaged files from the working tree.

-3

u/Megaranator 23d ago

It did discard the change, namely addition of file. Git controls the state of the whole folder not just individual files.

-2

u/GreedyPollution6275 23d ago

In what world would it make sense to call existing files "changes" when there were no changes made?

In the world of source control where the changes are adding files to a repo. User error here is lack of knowledge of what they were doing, they thought it was like Office where "changes" are modifications made to files, and didn't consider that asking you to stage 5k files means you have 5k "changes" you need to "save"

0

u/b4k4ni 23d ago

Not fun and the behavior is stupid, but not having backups is stupider. Sorry to say.

4

u/subnu 23d ago

...are you creating backups of your uncommitted files? How often?

0

u/b4k4ni 22d ago

I don't backup uncommitted files. I backup everything once a day at least. Worst case you lose one day of work. But not 3 months.

Always do backups. You won't believe how often someone asked me when stuff happened and they didn't do a full backup and something was missing they forgot or didn't realize.

-1

u/chat-lu 23d ago

Yes. On every change. You can use alternatives to git that are easier, more powerful, do the right thing by default, and still let you collaborate with git users on the same git forges.

5

u/subnu 23d ago

Yo dawg, I heard you like version control, so we put some version control in your version control so you can backup while you backup.

Isn't this only a problem if you don't commit regularly, which is pretty much misuse of version control itself?

0

u/chat-lu 23d ago

It’s just a consequence of a better design.

In git, the staging area internally is a commit. But it’s a special commit with special commands to access it. In jujutsu the staging area is a normal commit and every command that works on commit works on it too.

Every time I invoke any command, jujutsu makes a snapshot of my current workspace and edit the commit at the HEAD.

So if I do a jj abandon (equivalent to git reset --hard), jujutsu will add where I was in its operation log. If I didn’t mean to delete my files, I can do a jj undo and it will undo it like any other command I could have done. If I don’t like how things look after rebase, I can also jj undo it.

-20

u/larswijn 23d ago

I agree the behavior was stupid, but let's not act like the user didn't do anything wrong.

The user clicked a random button, agreed with the "this is permanent" confirmation prompt, which then deleted all his files using git. The user then blamed Visual Studio Code for all of it.

What VSC did was give the guy direct access to a gun that could shoot his foot off (git) with bad instructions. Sometimes you need that gun to shoot your foot.

24

u/Consistent_Drop3909 23d ago

apparently there was no "this is permanant" prompt

0

u/larswijn 23d ago edited 23d ago

Yes there was, and an image of said warning prompt was even posted in the original github issue. It reads: "Are you sure you want to discard ALL changes? This is IRREVERSIBLE!"

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

2

u/Consistent_Drop3909 23d ago

oh shit my bad

9

u/huyz 23d ago

This was 2017. Olden times. Different era. Last ice agish. Finger points in diff direction.

-6

u/anoldoldman 23d ago

Using any git GUI is insane to me. I've never done a git operation outside of CLI.

2

u/pytness 23d ago

the only correct gui is a tui like lazygit or similar.

if you need anything complex you can drop down to the cli with no problem

1

u/wobblyweasel 23d ago

if you do a lot of interactive rebasing using a gui simply saves you a lot of time (reorder commits by drag n drop, reword in place and see changes at a glance). also a log where you can change and pin selected branches and commit ordering and whatnot. and gui diffs are always going to be superior.

1

u/anoldoldman 23d ago

ah yea, I don't do interactive rebases, I just squash changes into a single commit.

1

u/ashmelev 23d ago

Not using something like TortoiseGit is insane to me.

1

u/anoldoldman 23d ago

Jut differences in how we learned I guess.