- mox ( @mox@lemmy.sdf.org ) 101•6 days ago
In case anyone else is wondering, or simply doesn’t like reading screen shots of text, this is apparently a real report:
This link was included in the post but I realize that “source” was probably not the best label for it. Updated to make it more clear.
- AnAmericanPotato ( @AnAmericanPotato@programming.dev ) English84•6 days ago
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.
- Omega_Jimes ( @Omega_Jimes@lemmy.ca ) 44•6 days ago
I’m not great at English, but “discard all changes” shouldn’t ever mean “Delete”.
- Michal ( @Michal@programming.dev ) 27•6 days ago
In the context of version control it does. Discarding a change that creates a file means deleting the file.
- Omega_Jimes ( @Omega_Jimes@lemmy.ca ) 3•6 days ago
Ok fair enough, but I’m under the impression these files existed before the source control was implemented.
I guess it’s all up to how the program handles existing files.
- FiskFisk33 ( @FiskFisk33@startrek.website ) 4•6 days ago
I guess the newly created git repository was empty, and all the files that was present in the folder represented “changes”
- JackbyDev ( @JackbyDev@programming.dev ) English2•5 days ago
“Discard” is not a git operation.
- stebo ( @stebo02@lemmy.dbzer0.com ) 4•6 days ago
I’m pretty sure vscode shows a confirmation dialog when discarding changes will permanently delete a file. I’ve done that recently with temporary files that were no longer needed.
- JackbyDev ( @JackbyDev@programming.dev ) English2•5 days ago
Did you even read the thread?
- stebo ( @stebo02@lemmy.dbzer0.com ) 3•5 days ago
the alternative to deleting is emptying the file contents, which is essentially the same…
- cocobean ( @cocobean@bookwormstory.social ) English26•6 days ago
Also, why not send them to the recycle bin? I never really thought about it before, but that does seem a reasonable UX improvement for this case
- murtaza64 ( @murtaza64@programming.dev ) 3•6 days ago
I wonder if there’s already a git extension to automatically stash the working tree on every clean/reset/checkout operation…
- JackbyDev ( @JackbyDev@programming.dev ) English4•5 days ago
It’s so fucking infuriating that so many devs act like this. “This should’ve been obvious!” Fuck off, that’s an unhelpful statement. “You should’ve been using version control! No backup, no sympathy!” Fuck off, they were literally trying to begin using version control for backups.
Even half the comments on this very Lemmy thread are disparaging this dev. I wonder how many actually read the thread and found that there was a bug discovered causing this feature to delete files not even associated with git?
But, congratulations to them, I suppose. Congratulations on making fun of someone. I hope it makes them feel powerful. 🙄 Devs can be so toxic.
- kehet ( @kehet@sopuli.xyz ) 3•5 days ago
Came here to say this. No one deserves this, not even new programmers who try to learn things.
Some programming tools are really powerful compared to what new users are used to. If you come from the world of Microsoft Office and Apple whatever it’s called, everything is saved automatically to cloud and there is some local backup file somewhere which you can just restore. Modern programs are designed to protect users against their own mistakes, and when suddenly that is taken away, it can be a jarring experience.
- Scary le Poo ( @Scary_le_Poo@beehaw.org ) 1•5 days ago
If you’re going to use a git tool, you need to know how git works.
There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?
No sympathy. Dude is a shit developer and he learned an invaluable lesson.
- AnAmericanPotato ( @AnAmericanPotato@programming.dev ) English6•5 days ago
My guess is that this is a teenager, and this is probably their first experience with git and version control in general. Just a hunch.
Anyway, it is reasonable to expect a mainstream GUI app from one of the largest companies in the world to be approachable for people who do not know all the inner workings of the command line tools that are used behind the scenes. And it is reasonable to expect any destructive action to have clear and bold warnings. “Changes will be discarded” is not clear. What changes? From the user’s perspective, the only changes were regarding version control, so “discarding” that should leave them where they started — with their files intact but not in version control.
Have mercy on the poor noobs. We were all there once.
- JackbyDev ( @JackbyDev@programming.dev ) English2•5 days ago
If you’re going to use a git tool, you need to know how git works.
I guarantee you at least half of git users would get glossy eyes as soon as you mention blobs and trees, yet they all still manage to use it daily successfully.
There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?
I need you to listen to me very carefully: THEY WERE FUCKING SETTING UP A REPO WHEN THIS HAPPENED.
- Scary le Poo ( @Scary_le_Poo@beehaw.org ) 1•5 days ago
No, by his own admission, he was playing around with the IDE. He wasn’t interested in the version control, he was interested in the pretty editor.
I suggest you go read the original issue.
- _____ ( @_____@lemm.ee ) English68•6 days ago
let’s turn this into a constructive angle for future devs and current juniors: just learn git cli, I promise you it is much simpler than it seems.
all those memes about git having like a thousand commands are true, but you really will only use like 7 at most per month.
learn push, pull, merge, squash, stash, reset, im probably missing like one or two
I promise you again: it is much simpler than it seems. and you won’t have to use these stupid git GUI things, and it will save you a hassle because you will know what commands you are running and what they do
short disclaimer: using git GUI is totally fine but low-key you are missing out on so much
- sour ( @sour@feddit.org ) English38•6 days ago
im probably missing like one or two
commit. Lol
- TechieDamien ( @TechieDamien@lemmy.ml ) 7•6 days ago
Checkout
- Piatro ( @Piatro@programming.dev ) English6•5 days ago
The main draw to the CLI for me is portability. I’ve been a dev for ten years now and used tons of different editors on different platforms and while each one had a different way to describe the changes, how to commit, or how to “sync” (shudder), the CLI hasn’t changed. I didn’t have to relearn a vital part of my workflow just because I wanted to try a different editor.
- Cethin ( @Cethin@lemmy.zip ) English5•6 days ago
Personally, I’m pretty good with the CLI version, but sometimes I just use the Code VC interface. For some tasks (basic commit, pull, push) it’s pretty fast. I don’t know if it’s faster than CLI, but I switch between them depending on what I’m doing at that moment. Code has a built in console, so using either is pretty seemless and easy. If you only use the GUI you won’t ever understand it though. I think everyone should start with CLI.
Honestly, this is true for almost everything. GUIs obfiscate. They don’t help you learn, but try to take control away so you can’t mess up, and as an effect can’t do everything you may want.
- CodeMonkey ( @CodeMonkey@programming.dev ) 1•5 days ago
For me, it is easier to learn to use
git
via CLI instead of a UI. When I first started using git, I learned a few command/flag combinations that I use every day and I barely learned anything else about git after. Everything I don’t do regularly I don’t remember, but have written down in a text file of incantations. It is harder to write down what buttons and what menus I have to click.
- unalivejoy ( @joyjoy@lemm.ee ) English43•6 days ago
Say you don’t know how to use git without saying you don’t know how to use git.
- ChaoticNeutralCzech ( @ChaoticNeutralCzech@feddit.org ) English24•6 days ago
That’s what happens when people stumble across that website called GitHub, get hooked and now have unrealistic expectations for the real git.
“I just installed Git for Windows. Where is the drag-to-upload box?”
— A statement dreamt up by the utterly deranged
Real git involves a lot of sweat, requires you to clean up any mess you make, and communicate with any partners about their preferred techniques instead of rawdogging it and waiting for issues. The pushing and pulling will come naturally but you need to know how and when to release, and be clear about how you wish to commit. Nightly is an option but good luck getting everyone on board. People might judge you for using the word “master” but it should be alright in private.
- BearOfaTime ( @BearOfaTime@lemm.ee ) 7•6 days ago
People might judge you for using the word “master” but it should be alright in private.
I snorted. It was my inner 12-year-old’s fault. (Also because of recently some idiots getting up in arms about these terms in technology.)
- Prandom_returns ( @Prandom_returns@lemm.ee ) 1•5 days ago
“up in arms”:
Reality:
– “just don’t use them, some people find them offensive”
– “ok”Anonymous techbros online:
“yOu CanT sAY aNYtHiNg ThEsE daYs”
- 4am ( @4am@lemm.ee ) 6•6 days ago
involves a lot of sweat, requires you to clean up any mess you make, and communicate with any partners about their preferred techniques instead of rawdogging it and waiting for issues. The pushing and pulling will come naturally but you need to know how and when to release, and be clear about how you wish to commit. People might judge you for using the word “master” but it should be alright in private.
Don’t talk about my mom that way
- bjorney ( @bjorney@lemmy.ca ) 11•6 days ago
Git doesn’t automatically recursively add all files in the directory to the repository though - VSCode decided that should be the default behavior, while other editors (intellij) ask if you want to add newly created files to version control
- hex ( @hex@programming.dev ) 1•5 days ago
I just hate the vscode source control. It has always felt clunky and like it breaks things (or i just never figured out the workflow - either way i dont need it lol) It is way clearer to see what is happening the console
- ApexHunter ( @ApexHunter@lemmy.ml ) 1•6 days ago
That’s how git works. Every file and subfolder under the repo’s root folder belongs to the repo.
- bjorney ( @bjorney@lemmy.ca ) 2•5 days ago
What does
git add xxx
do then
- Kaeru ( @Kaeru@slrpnk.net ) English8•6 days ago
Alright you convinced me its time to pick up this skill. How does one best learn git? Just play around with it and break things?
- LordPassionFruit ( @LordPassionFruit@lemm.ee ) 5•6 days ago
That’s basically how I did it.
To properly learn it using this method, create a directory that contains only text files and sub directories and treat it like a real project. Add files, delete them, play around with updating the repository. Try and go back a few updates and see how the things react. Since it’s not a real project there’s no risk of loss, but you’ll still get to see the effects of what you do.
- onlinepersona ( @onlinepersona@programming.dev ) English40•6 days ago
The reactions here are why people don’t join forums, don’t ask questions, or choose to learn alone. “duh, I knew that”. Yes, the dude didn’t, which is exactly why he’s frustrated. I think too many have forgotten what it’s like to be a beginner and make a fatal mistake, which would explain the mocking responses here and things like recommending new linux users Arch.
- Zagorath ( @Zagorath@aussie.zone ) English24•6 days ago
I understand the impulse to be empathetic and kind. But it’s very hard to respond in good faith to someone who just made a post where more than half the words are “fuck you”.
- CosmicTurtle0 ( @CosmicTurtle0@lemmy.dbzer0.com ) English10•6 days ago
There is a difference between someone who is new and experiences something like their IDE deletes a file that was unexpected and asking a question about why it did that.
Then there are arrogant assholes who believe their shit doesn’t stink and that they couldn’t have done anything wrong and it was the IDE’s fault for not knowing what they wanted to do versus what they commanded it to do.
The OP is the latter.
- rothaine ( @rothaine@lemm.ee ) 13•6 days ago
I mean, not entirely, and he says he lost months worth of work. Like imagine you know nothing of git:
-
Click buttons in the IDE to add source control.
-
IDE says a bunch of files have been changed.
-
But I don’t want to make changes to the files, I want to source control them.
-
Attempt to undo the changes. Click “discard changes” thinking it will put them back to how they were before clicking add source control. Get a warning dialog that this is not undoable, but that’s fine because I don’t want whatever changes it made to my files anyway.
-
All files are deleted and unrecoverable.
Like that experience sucks balls and it’s reasonable that a person wouldn’t expect “discard” == “delete”. Also, from reading the GitHub thread, apparently at that time VSCode was doing a
git clean
when you clicked this. Which like…yeah why the hell would it do that lol? I don’t think I have ever usedgit clean
in my entire career.- Scary le Poo ( @Scary_le_Poo@beehaw.org ) 1•5 days ago
Months worth of work. Going an entire day without committing should never happen. Also, rawdogging it without a backup?
Nope, dude learned a hard lesson. No sympathy. He thought that the rules of data storage don’t apply to him and he got boned.
- rothaine ( @rothaine@lemm.ee ) 3•5 days ago
He did learn a hard lesson, but it sounds like this was exactly what he was attempting to rectify. “This project is pretty important to me. I should probably figure out how to use source control and put it on GitHub” but then by doing so, and due to some arguably poor UX decisions in VSC, destroyed the project.
If someone’s trying to learn how to do something you can’t just be like “well you should’ve already known how”, you know what I mean?
Well actually, let’s qualify that: there are cases where people try to jump right in the deep end. “I’m just learning woodworking! Step 1: build a new deck for my house”, like yeah bro what are you doing, let’s start with a birdfeeder or something.
But that’s not what happened here. He tried to use the built-in GUI, which many would assume would be easier to learn than jumping right to the CLI, and it burned him in a way he didn’t even realize was possible.
-
- Dragon Rider (drag) ( @dragonfucker@lemmy.nz ) English3•6 days ago
He’s right, his shit doesn’t stink. His decision making was reasonable for a new programmer.
- RobotZap10000 ( @RobotZap10000@feddit.nl ) English37•6 days ago
5000 files
0 backups
Someone’s got their priorities mixed up.
- TheNSFWConnoisseur ( @TheNSFWConnoisseur@lemmynsfw.com ) 14•5 days ago
having 5000 backups of 0 files is also kinda pointless.
- Reil ( @Reil@beehaw.org ) English3•5 days ago
Yeah, those are novice numbers. I have infinite backups of my 0 files!
- QuazarOmega ( @QuazarOmega@lemy.lol ) 9•5 days ago
You have to lose it all to know what matters (speaking from experience 😭)
- JackbyDev ( @JackbyDev@programming.dev ) English3•5 days ago
And they were trying to correct their priorities by looking into the source control features, so I don’t see how that’s anything other than victim blaming for them not doing it sooner.
- MystikIncarnate ( @MystikIncarnate@lemmy.ca ) English1•5 days ago
I would argue that it’s common sense to at least make a point in time copy, to… IDK, a USB drive? Before trying to implement a new source/control system.
Just plug in an external drive, or a thumb drive, copy/paste, unplug it, then proceed with testing.
I don’t see how anyone who values their time and effort could do any less.
As for the files, undelete is a thing, and it shouldn’t be hard to do.
- JackbyDev ( @JackbyDev@programming.dev ) English34•6 days ago
I fucking HATE when abstractions over git use cutesy names that git doesn’t use.
- MystikIncarnate ( @MystikIncarnate@lemmy.ca ) English12•5 days ago
While I have some sympathy for anyone who loses months of work, as an IT administrator by day, all I have to say about their lack of backups, and lack of RTFM before messing with shit is:
HAHAHAHAHAHAHA HAHAHAHAHA. you got what you deserved fucker. GL.YF.
- ursakhiin ( @ursakhiin@beehaw.org ) 1•4 days ago
Anybody who has over 50 project files and doesn’t have it in an SCM in making mistakes in life.
- jlow (he/him) ( @jlow@beehaw.org ) 28•6 days ago
Backups, backups, backups.
- filcuk ( @filcuk@lemmy.zip ) 3•6 days ago
Like, damn son, at least make a daily archive of your project??
You have to expect things to go wrong, otherwise you have no one but yourself to blame.
- Gamma ( @GammaGames@beehaw.org ) English21•6 days ago
Screenshots of git issues are one of my favorite genres of meme
- computerscientistII ( @computerscientistII@lemm.ee ) 18•5 days ago
No backup, no sympathy.
- sabreW4K3 ( @sabreW4K3@lazysoci.al ) 18•6 days ago
Doing a
git clean
is a dick move.- BatmanAoD ( @BatmanAoD@programming.dev ) 13•6 days ago
The user clicked an option to “discard” all changes. They then got a very clear pop-up saying that this is destructive and cannot be undone (there’s a screenshot in the thread).
- Peer ( @Peer@discuss.tchncs.de ) 20•6 days ago
I very much understand how one can think this would revert any changes done to files under version control but not delete the ones that are not. I believe this dialog has since been updated to explicitly state that fact.
- BatmanAoD ( @BatmanAoD@programming.dev ) 7•6 days ago
Yes, the dialog was changed, as part of this linked issue (and maybe again after that; this whole incident is very old). After reading some of the comments on that issue, I agree with the reasoning with some of the commenters that it would be less surprising for that menu option to behave like
git reset --hard
and not delete tracked files.
- astrsk ( @astrsk@fedia.io ) 5•6 days ago
Yeah, real developers do
git clean -dxf
.
- BougieBirdie ( @Bougie_Birdie@lemmy.blahaj.zone ) English15•6 days ago
Often times, people learn that the stove is hot by touching it.
It’s easier to blame the stove than the person who touched it. But if you laugh when you watch it happen, you’re probably not laughing at the stove.
- Artyom ( @Artyom@lemm.ee ) 14•6 days ago
If you ever happen to have 5000 uncommitted files, you shouldn’t be asking yourself if you should commit more often. You should be asking yourself how many new repos you should be making.
- expr ( @expr@programming.dev ) 1•5 days ago
Monorepos are a thing. But obviously this is something entirely different.
- joewilliams007 ( @joewilliams007@kbin.melroy.org ) 8•6 days ago
please fix uwu