• مهما طال الليل
    link
    fedilink
    0
    edit-2
    1 month ago

    So VS Code isn’t just slow and bloated, it also deletes your files. So glad I was turned off by its excessive memory consumption and deleted it before it deleted my files.

    Edit: also why I only ever used git from the command line, I never found a git UI that is easy to understand, and never trusted them.

  • @Treczoks@lemmy.world
    link
    fedilink
    -11 month ago

    Someone who does not know about “permanent delete” and not having backups, especially when switching to a new system, should have no business complaining about this.

  • @onlinepersona@programming.dev
    link
    fedilink
    English
    511 month 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.

    Anti Commercial-AI license

    • Zagorath
      link
      fedilink
      English
      371 month 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”.

          • @Buddahriffic@lemmy.world
            link
            fedilink
            141 month ago

            I disagree that that warning is reasonably clear. Even the comment that included it has the line of thought, where the user, not knowing what terms git uses thinks that they just did an action that is going to change each of their files. It makes sense that they’d want to discard those changes. That user then goes on with some snark about not wanting to learn any more about what they are playing with and that other programs would do the same, but “discard changes” seems like it would have a clear meaning to someone who doesn’t know git.

            The warning says it isn’t undoable but also doesn’t clarify that the files themselves are the changes. Should probably have a special case for if someone hits discard changes on a brand new repository with no files ever checked in and hits discard on a large number of files instead of checking them in. Even a “(This deletes all of the local files!)” would make it clear enough to say what the warning is really about.

            • @friendlymessage@feddit.org
              link
              fedilink
              81 month ago

              Even if you know git, you wouldn’t assume that “discard all changes” affects untracked files. It’s bad design all around

              • @BatmanAoD@programming.dev
                link
                fedilink
                11 month ago

                That depends on what you map “discard” to in your mental model. Whoever designed the VSCode feature chose to associate it with reset+clean, rather than just reset. Presumably that’s why they called the menu option “discard” rather than “reset”. (But I agree that this is a surprising choice, and that they managed to make an already-famously-bad UX even worse.)

          • @Prandom_returns@lemm.ee
            link
            fedilink
            21 month ago

            “Discard changes” is usually equivalent to “cancel” or “quit without saving”. Not shift+delete files lol.

            • @BatmanAoD@programming.dev
              link
              fedilink
              1
              edit-2
              1 month ago

              Well, yeah, that’s why they updated the warning pop-up. It’s still the case that the user didn’t bother to find out what the warning meant before choosing the inherently destructive option.

              Here’s the revised pop-up, according to the linked ticket:

              I haven’t checked the current behavior (this whole incident was seven years ago).

          • OK this is hilarious

            When you sell hammers you’ll likely have people using them to hit their own heads, which, understandably, they will put the hammer at fault. Now, we already put a big don’t hit this on your own head label on our hammer. Should we actually prohibit people from head hitting with our hammers? Probably not, since some users still want to hit heads with it. It’s just how hammers work.

          • If you have no idea what Git is, that warning message is not telling you you’re about to delete 5000 files.

            But I wonder if this person maybe does know about Git because they used the word „stage“.

            • @BatmanAoD@programming.dev
              link
              fedilink
              11 month ago

              If you don’t know what git is, you should probably avoid choosing the “confirm” option when you’re warned that an operation is dangerous.

              That said, I think the change they ultimately made in the linked issue, which words the warning differently and, more importantly, provides an option to only discard changes to already-tracked files, is a vast improvement.

    • @CosmicTurtle0@lemmy.dbzer0.com
      link
      fedilink
      English
      91 month 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.

      • Dragon Rider (drag)
        link
        fedilink
        English
        51 month ago

        He’s right, his shit doesn’t stink. His decision making was reasonable for a new programmer.

      • @rothaine@lemm.ee
        link
        fedilink
        201 month 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 used git clean in my entire career.

        • Scary le Poo
          link
          fedilink
          11 month 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@lemm.ee
            link
            fedilink
            31 month 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.

  • @merthyr1831@lemmy.ml
    link
    fedilink
    English
    -1
    edit-2
    1 month ago

    This is 2000% user error lmao even tho VS Code is a pain in the ass on w*ndows

    EDIT nvm my reading is 2000% user error

  • katy ✨
    link
    fedilink
    1
    edit-2
    1 month ago

    i mean doesn’t it just integrate with explorer/tortoisegit so all the files would go to the recycle bin anyway?

    either that or this: https://stackoverflow.com/a/72695095

    Step 1: Enter Ctrl + Shift + P on VSC

    Step 2: Choose the option “Local History: Find Entry to Restore”

    Step 3: Find the file which you want to restore

    Step 4: Choose a time you save that file

    Step 5: Copy file content and restore it

  • @josefo@leminal.space
    link
    fedilink
    -71 month ago

    Fuck around things you don’t understand, find out. Why even go near the source control area and start clicking stuff if you don’t know jack shit about it.

    • @rothaine@lemm.ee
      link
      fedilink
      341 month ago

      It seems like he was trying to learn though? He clicked it, like “hell yes I want source control, let’s figure this out”

      “It says all my files are changed? Oh shit why did it change my files? Shit fuck, undo, how do I undo…Do I want to discard the changes? I don’t even know what it changed. Yes please undo whatever changes you did to my files”

      And poof.

  • @AnAmericanPotato@programming.dev
    link
    fedilink
    English
    1481 month 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@lemmy.ca
          link
          fedilink
          31 month 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.

        • @thebestaquaman@lemmy.world
          link
          fedilink
          151 month 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.

      • stebo
        link
        fedilink
        31 month ago

        the alternative to deleting is emptying the file contents, which is essentially the same…

      • stebo
        link
        fedilink
        51 month 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.

    • @cocobean@bookwormstory.social
      link
      fedilink
      English
      431 month 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

    • JackbyDev
      link
      fedilink
      English
      41 month 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@sopuli.xyz
      link
      fedilink
      51 month 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
      link
      fedilink
      -3
      edit-2
      1 month 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.

      • JackbyDev
        link
        fedilink
        English
        21 month 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
          link
          fedilink
          01 month 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.

      • @AnAmericanPotato@programming.dev
        link
        fedilink
        English
        71 month 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
    link
    fedilink
    English
    531 month ago

    I fucking HATE when abstractions over git use cutesy names that git doesn’t use.

  • @_____@lemm.ee
    link
    fedilink
    English
    1221 month 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

    • @apostrofail@lemmy.world
      link
      fedilink
      11 month ago

      How about Git’s CLI stop being so shit? All of the options are obtuse & usually 3 ways to do the same thing.

      Developers should normalize non-Git DVCSs.

    • Cethin
      link
      fedilink
      English
      7
      edit-2
      1 month 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.

    • @thebestaquaman@lemmy.world
      link
      fedilink
      61 month ago

      I use gitkraken for two primary purposes:

      1. Having a visual representation of my project history.

      2. resolving merge conflicts

      Of these, the first is really the only thing I really want a GUI for. I’ll just have it open on my side-screen if I’m managing some more or less messy branch structure or quickly want an overview of what has been done on which branches, where common ancestors are, etc. All the actual doing of things is done from the CLI, because it’s just better for that.

    • @Piatro@programming.dev
      link
      fedilink
      English
      111 month 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.

    • @MajorasMaskForever@lemmy.world
      link
      fedilink
      English
      181 month ago

      Every time I mentor a dev on using git they insist so much on using some GUI. Even ones who are “proficient” take way longer to do any action than I can with cli. I had one dev who came from SVN land try and convince me that TortoiseGit was the only way to go

      I died a little that day, and I never won her over to command line despite her coming to me kinda regularly to un-fuck her repository (still one of the best engineers I ever worked with and I honestly miss her… Just not her source control antics)

      • @_____@lemm.ee
        link
        fedilink
        English
        31 month ago

        that’s exactly why I’m saying this. I know from experience helping other devs with git issues it’s always because they’re using a GUI alternative to the CLI and they’re clicking on things they don’t understand

      • @dave@feddit.uk
        link
        fedilink
        English
        61 month ago

        So I’m normally a command line fan and have used git there. But I’m also using sublimerge and honestly I find it fantastic for untangling a bunch of changes that need to be in several commits; being able to quickly scroll through all the changed files, expand & collapse the diffs, select files, hunks, and lines directly in the gui for staging, etc. I can’t see that being any faster / easier on the command line.

        • @MajorasMaskForever@lemmy.world
          link
          fedilink
          English
          31 month ago

          Heh, I guess this shows my corporate software dev experience. Whenever I’ve taught git workflows it was always paired with a work ticketing system where any changes you were making were ideally all one single set of changes. If you need a feature or bug fix someone else was doing that was being done on another branch which you could pull into your code early and for tracking purposes we always made sure the other person merged into main first. The only time I’ve seen per line manipulation with git was when someone made a ton of changes in a file and wanted to revert a handful of lines.

          Everything else you mentioned I’ve had a web git host like gitlab or bitbucket for, but I kinda put that more into peer review workflow than git itself

        • @MajorHavoc@programming.dev
          link
          fedilink
          2
          edit-2
          1 month ago

          Welcome to the brotherhood. Haha. Ow.

          Using SVN was like a having a thoughtful professional assistant who ignored half of what I said and occasionally threw medium sized objects at my head without warning.

          You’re allowed to mock the whole organization mercilessly until they upgrade to git. Git is completely free, and the available upgrade tools are lossless. Also git actually works perfectly fine when naively treated like SVN.

          Source: I used git naively like SVN for awhile after (flawlessly) upgrading a huge number of repositories.

        • @MajorHavoc@programming.dev
          link
          fedilink
          51 month ago

          You’re 100% right.

          But I defy anyone’s mouse-foo to come anywhere near the speed of my typing speed and alias list.

          Even someone mastering GUI keyboard shortcuts isn’t going to be able to match, because my terminal is optimized beyond what is possible in a more graphical app.

          What I’m trying to say is that no one can introduce a thoughtless mistake into production code as quickly as I can.

          • @MajorasMaskForever@lemmy.world
            link
            fedilink
            English
            31 month ago

            The real metric is dollars per second of destroyed hardware ;)

            I once watched an engineer blow up a $200k prototype with a terminal alias.

            • @MajorHavoc@programming.dev
              link
              fedilink
              11 month ago

              That’s impressive. I’m glad I don’t have any story to match that. Hopefully they find it hilarious now. Probably no fun at the time.

        • @MajorasMaskForever@lemmy.world
          link
          fedilink
          English
          61 month ago

          That is the one use case I’ve seen where a gui is absolutely faster.

          In my line of work, I primarily work on embedded systems or process automation so any new files in the repo directory either need to be added for tracking or to the ignore file. I’m not saying it will never happen, but at least in my experience it happens so rarely that I always try to teach command line when possible

        • @ulterno@programming.dev
          link
          fedilink
          English
          2
          edit-2
          1 month ago

          Did you not know?
          You can simply select all files you want to commit, in the File Manager, Ctrl+C, then paste in the terminal and it will automatically add all those file names (full paths) separated with spaces at the cursor. At least in KDE: Dolphin -> zsh + Konsole it does.

          And sure, it might look like 2 extra steps, but you will still be clicking around a lot in case of a GUI anyway.

          I tend to just type partial filenames and use tab completions, which are also pretty configurable. And the only dissatisfaction I have rn, is that I don’t have zsh module for completions with pascal case and snake case.

    • @Atlas_@lemmy.world
      link
      fedilink
      81 month ago

      For a first step you can get away with just add, commit, push, and pull. Maybe reset, but tbh using git like svn at first is fine.

      Next branch, checkout and merge. At this point show, log, bisect and blame also start to be useful.

      I’m not a fan of stash, and would instead recommend reflog and cherry-pick as the first two advanced commands to learn. Then rebase and squash.

    • @CodeMonkey@programming.dev
      link
      fedilink
      11 month 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.