• Korne127@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 months ago

      The person didn’t have any git repository; probably a new programmer that didn’t know how version control works and just clicked discard without understanding what that means in this situation

    • Mixel@feddit.org
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 months ago

      I have heard things from another apprentice who just does not use version control at all and the only copies are on his laptop and on his desktop. He is also using node.js with only 1 class and doesn’t know about OOP (not sure if you even use that in js no clue 😅) and has one big file with 20k lines of code I have absolutely no clue how he navigates through it

      • Blackmist@feddit.uk
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 months ago

        Those are rookie numbers. I have at least a 35k one somewhere. More than one actually.

        People run their businesses on this.

        • fibojoly@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          2 months ago

          I once landed a job at a small company doing a software for medical analysis labs all over the country. Software had been around for over ten years at this point. They had no source control. Nothing. Absolute nightmare.
          They were literally starting to use source control when I arrived.
          In 2015.

          • Blackmist@feddit.uk
            link
            fedilink
            English
            arrow-up
            1
            ·
            2 months ago

            The “source control” when I first started was all the code on a shared drive, to check out a file you copied it to your machine, and renamed the extension on the shared drive to your initials.

            When somebody edited without doing this there would be full blown meltdowns over lost work.

      • LANIK2000@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        2 months ago

        Ey! Reminds me of my middle-school years! I still can’t belive I made an entire game without a single class… Just storing info in arrays and writing in comments what location represents what data. But I was a literal child, too young to read guides or sit through “long” tutorials.

        I don’t want to sound too mean, but whenever I see anything similar at work, I wish that person get a job they’re actually good at. It’s fine and all that the company started hiring actual programmers to fix things, but the fact that the old crew still fucks shit up with senior privileges is a major grievance.

      • e8d79@discuss.tchncs.de
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

        I know the type. Usually the kind of confident know-it-all who refuses to learn anything but delivers changes really quickly so management loves them. I had the misfortune to fix such a project after that ‘rock-star’ programmer left the company. Unfortunately the lack of professional standards in our industry allows people like that to continuously fail upwards. When I left the project they rehired them and let them design the v2 of the project we just fixed.

        • MajorHavoc@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          2 months ago

          When I left the project they rehired them and let them design the v2 of the project we just fixed.

          Lol. Wow.

          And that is why I’ve been unable to work myself out of a job in all my long years as a developer.

        • LANIK2000@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          2 months ago

          Jesus, reminds me of a similar story. My gf once lost a job to someone who literally just pasted code into LLMs, also delivering quickly, even tho it was hot garbage. Anyhow, she spent a lot of her time fixing his shit and so her output went down. I hope that company burns to the ground with completely un manageable software.

        • AlexWIWA@lemmy.ml
          link
          fedilink
          English
          arrow-up
          2
          ·
          2 months ago

          We really need some kind of board like the one that controls the title for engineers.

        • RagingRobot@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          2 months ago

          My company for the longest time had two engineers they would give all the new projects to. They would rush through some prototype code as fast as they could then management would bring in a new team to take the project over. The code was always garbage and crammed into one place. I kept getting new projects and instead of starting from a nice clean slate we always had to build on that garbage. It sucked so bad.

    • eating3645@lemmy.world
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 months ago

      Steps to Reproduce:

      1.Go near this fucking shit editor.

      2.Commit the deadly sin of touching the source control options.

      🤣

        • Hawke@lemmy.world
          link
          fedilink
          arrow-up
          2
          ·
          2 months ago

          I dunno, “discard changes” is usually not the same as “delete all files”

          • bleistift2@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            2
            ·
            2 months ago

            Nowadays the warning even says that this cannot be undone. Maybe that wasn’t present in 1.15, though.

            • TopRamenBinLaden@sh.itjust.works
              link
              fedilink
              English
              arrow-up
              3
              ·
              2 months ago

              It was. If you go through the OP thread, one of the responses is a picture of the dialog window that this user clicked through saying, “these changes will be IRREVERSIBLE”.

              The OP was just playing with a new kind of fire (VSCodes Git/source control panel) that they didn’t understand, and they got burned.

              We all gotta get burnt at least once, but it normally turns us into better devs in the end. I would bet money that this person uses source control now, as long as they are still coding.

          • josefo@leminal.space
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            If the “changes” are all your files, discarding them for me means basically delete my files, you know, the ones you are trying to add.

            • T156@lemmy.world
              link
              fedilink
              English
              arrow-up
              1
              ·
              edit-2
              2 months ago

              At the same time, OP seems a layman, and might be coming from things like Microsoft Word, where “Discard all changes” basically means “revert to last save”.

              EDIT: After reading the related issues, OP may have also thought that “discard changes” was to uninitialise the repository, as opposed to wiping untracked files.

            • Hawke@lemmy.world
              link
              fedilink
              arrow-up
              1
              ·
              2 months ago

              “Changes” are not the same thing as “files”.

              I’d expect that files that are not in version control would not be touched.

              • Pyro@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                edit-2
                2 months ago

                “Changes” encompass more than you think. Creating / Deleting files are also changes, not just edits to a file.

                If the change is an edit to a tracked file, “Discard Changes” will reverse the edit. If the change is a new untracked file, “Discard Changes” will remove it as intended.

                It can also be both at the same time, which is why VSCode uses “Changes” instead of “Files”.

                • candybrie@lemmy.world
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  2 months ago

                  If the change is a new untracked file

                  Wasn’t the issue that it deleted a bunch of preexisting untracked files? So old untracked files.

              • EleventhHour@lemmy.world
                link
                fedilink
                English
                arrow-up
                0
                ·
                edit-2
                2 months ago

                Apparently, it means changes to the directory structure and what files are in them, not changes within the files themselves. It really ought to be more clear about this.

              • MajorHavoc@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                2 months ago

                Yeah. That’s discussed in more detail in the code change that resulted from the issue report.

                It’s a ballsy move by the VSCode team to not only include git clean but to keep it after numerous issue reports.

                As others discussed in that thread, git clean has no business being offered in a graphical menu where a git novice may find it.

                That said, I do think the expanded warning mesage they added addresses the issue by calling my out that whatever git may think, the user is about to lose some files.

        • Miles O'Brien@startrek.website
          link
          fedilink
          English
          arrow-up
          0
          ·
          2 months ago

          Having done exactly 0 research, I going to assume it’s one of those “DO NOT PRESS OKAY UNLESS YOU ARE EXPERIENCED AND KNOW WHAT YOU ARE DOING” and someone went “pffft I know what I’m doing. click now what does this option do…”

          • bamboo@lemmy.blahaj.zone
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            reading through it, it sounds like they opened a project in VSCode, and it saw that there was a local git repo already initialized, with 3 months of changes uncommitted and not staged. So the options there are to stage the changes (git add) to be committed or discard the changes (git checkout -- .). I guess they chose the discard option thinking it was a notification and i guess the filename would be added to gitignore or something? Instead, it discarded the changes, and to the user, it looked like VSCode did rm -rf and not that this was the behavior of git. Since the changes were never committed, even git reflog can’t save them.

              • bamboo@lemmy.blahaj.zone
                link
                fedilink
                English
                arrow-up
                0
                ·
                2 months ago

                Yeah, it’s unclear to me at the time if the dialogue box in the screenshot appeared when doing a select all operation, but it reads as though the OP dev didn’t understand git, discarded their work, and got upset that it was an option.

                Realistically if the dialogue box appeared, I’m not sure there would be anything else the IDE could do to prevent the dev from themselves. Perhaps reject operations affecting 5000 files? But then you’ll just have someone with the same issue for 4000 files.

                • Mad_Punda@feddit.org
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  edit-2
                  2 months ago

                  The issue I linked has a very good analysis of the UX issues and several suggestions for fixing these. They went with a minor iteration on the original message box, which not only includes a clearer message and the number of files affected, but also defaults to not touching untracked files (while preserving the option to delete untracked files as before).

              • Scoopta@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                2 months ago

                He said they’re not going to change it, just make the dialog a lot more clear and add a second button to it that will only do a reset without the clean.

              • MajorHavoc@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                2 months ago

                It appears that the behavior actually included a git clean. Which is insane in my opinion.

                Yeah. Building a convenient accessible context free way to run git clean…sure feels like the actions of someone who just wants to watch the world burn.

          • PostingPenguin@feddit.org
            link
            fedilink
            English
            arrow-up
            0
            ·
            2 months ago

            Nope. The scary warning is even screenshotted and used as an example in the post report discussion.

            It’s quite the fun read!

      • Lazycog@sopuli.xyz
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        The dude ranted for awhile in the issue thread and closed the issue himself too! lol

    • Maven (famous)@lemmy.zipOP
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      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.

  • مهما طال الليل@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months 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.

    • auzy@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      It’s really not slow or bloated. There’s a reason it’s so popular (even in Linux)

      If it’s running slow, maybe it’s time to check your computer…

      I literally had to use it to load 100 git projects simultaneously recently

    • AwkwardLookMonkeyPuppet@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months ago

      No it doesn’t delete your files. Hombre from the post told it to delete his files and was then shocked when it did. It even warms you that it’s about to delete your files. Then on top of that, post person wasn’t even using source control, so they can’t get their files back. Don’t mess with the source control options if you’re not using source control. Don’t just randomly click buttons without reading if your project files are super critical. Don’t only have a single version of your entire project in a single place on one computer. This person obviously has no idea what they’re doing, which is fine, but they don’t belong anywhere near a 5000 file project.

    • hperrin@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      You think VS Code is slow and bloated? What do you use?

      Also, on several occasions I’ve had VS Code help me recover accidentally deleted files, because the editor keeps the file in memory, regardless of if it disappears on disk (like most editors).

    • dosuser123456@lemmy.sdf.org
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      28 days ago

      80% of my used storage accross all my drives (theyre a lot of them) is backups 💀

      might be a little paranoid…? idk

    • filcuk@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      2 months 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.

    • BatmanAoD@programming.dev
      link
      fedilink
      arrow-up
      0
      ·
      2 months 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@discuss.tchncs.de
        link
        fedilink
        arrow-up
        0
        ·
        2 months 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@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          2 months 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.

  • AwkwardLookMonkeyPuppet@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    2 months ago

    Why are they messing with the source control options when they’re not using source control? Perhaps learn about stuff before you start clicking buttons and performing delete operations on your super critical files?

  • riodoro1@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    Typical web developer. He didn’t even know files can be deleted without going into „recycle bin”

      • x00z@lemmy.world
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        I think it’s a joke about how noobs only learn javascript and make blazing fast webapps while knowing nothing about computers.

  • kamen@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    2 months ago

    I agree with the “learn the CLI”, but to newcomers I’ll also suggest to look at the IDE/editor’s output channel - if there’s GUI for Git, there are also most likely logs for what’s happening under the hood - even if a little noisy, it can be a good learning resource. And of course if you’re learning and unsure of what’s happening (with the CLI or through a GUI), do so in a non-destructive manner (by having proper backups).

    • GreenAppleTree@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      Even reset hard wouldn’t delete untracked files. This was a complete overreach by the GUI, performing a clean (and likely a forced one, as git’s requireForce defaults to true).

      And they did rectify that eventually, giving a warning, and an option to simply reset. It’s unfortunate this poor person had to be the trigger for that change.

  • Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months 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.

  • Artyom@lemm.ee
    link
    fedilink
    arrow-up
    0
    ·
    2 months 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.

    • Korne127@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      2 months ago

      The person didn’t have any git repository; probably a new programmer that didn’t know how version control works and just clicked discard without understanding what that means in this situation.

        • fum@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          git clean does. Turns out VSCode did a clean with that GUI option at that time, not sure of current behaviour.

        • GreenAppleTree@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 months ago

          ‘git reset’ won’t. ‘git clean’, on the other hand, most certainly does. Even then you have to --force it by default, to prevent an accidental clean.

      • ByteOnBikes@slrpnk.net
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        This person is why we have that meme where devs would rather struggle for a week than spend a few hours reading the documentation.

  • AnAmericanPotato@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    2 months 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
      arrow-up
      0
      ·
      2 months ago

      I’m not great at English, but “discard all changes” shouldn’t ever mean “Delete”.

      • Michal@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        2 months ago

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

        • thebestaquaman@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          2 months 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.

        • Omega_Jimes@lemmy.ca
          link
          fedilink
          arrow-up
          0
          ·
          2 months 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@startrek.website
            link
            fedilink
            arrow-up
            0
            ·
            2 months ago

            I guess the newly created git repository was empty, and all the files that was present in the folder represented “changes”

      • stebo@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        0
        ·
        2 months 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@programming.dev
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months 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
      arrow-up
      0
      ·
      2 months 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.

    • cocobean@bookwormstory.social
      link
      fedilink
      English
      arrow-up
      0
      ·
      2 months 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@programming.dev
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        I wonder if there’s already a git extension to automatically stash the working tree on every clean/reset/checkout operation…

      • stetech@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Because “the underlying Git nukes them right away, so why shouldn’t we perma-delete the files, too?”

        Anything else’d be effort…

    • Scary le Poo@beehaw.org
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      2 months 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@programming.dev
        link
        fedilink
        English
        arrow-up
        1
        ·
        2 months 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@programming.dev
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months 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@beehaw.org
          link
          fedilink
          arrow-up
          0
          ·
          2 months 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.

  • aliser@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    2 months ago

    deleted a chunk of my work the other day by pressing Ctrl z in windows explorer. my project was without source control installed (cuz it was in Dev stage), and Ctrl shit z/Ctrl y hotkeys didn’t work, so that chunk was just gone, persished forever… or so I though. I remembered vs code having a file history under some panel. found it, and here it was - at least some of the latest history of my file. lesson learned: even in Dev where nothing is yet working, finish your day of coding with a commit to a remote repo.

      • Dragon Rider (drag)@lemmy.nz
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        You can avoid this problem by not doing version control in your code editor. Different programs for different purposes. VS Code is fine for editing code and should not be used to manage an entire project.

      • Cethin@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        (VS)Code(ium) is great. (VSCode is MS fork of the OSS Codium.) It’s a popular editor with a lot of plugin for just about every language. It has an integrated console. It can do basic Version control (and you can use the console for anything more). It’s my favorite editor/IDE (not technically and IDE, at least out of the box). Just don’t do things you don’t understand. It’s that simple. The OP fucked around, and they found out what it does the hard way. It’s really easy to use if you have a basic understanding of things though.

      • locuester@lemmy.zip
        link
        fedilink
        English
        arrow-up
        0
        ·
        2 months ago

        Makes no sense to me. I’ve never had a single problem. Best ide I’ve ever used.

      • tiredofsametab@fedia.io
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        I begrudgingly switched to vscode a few years ago. I’ve never had any issues like this with it. My only issues have been with a plugin that I installed optionally (and that was later fixed by the plugin author).

      • CaptPretentious@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        2 months ago

        Viscose is absolutely fine.

        Most of these comments can be reduced to either

        1. I use CLI by the way…

        2. Hating on vscode because it’s Microsoft product and for no other reason.

        A Gitlab/GitHub account is free. Vscode absolutely lets you type git commands if you prefer that, The GUI only provides access to the most common actions you will do. And I could be wrong on this, but I feel like the discard button does prompt the user that the files will be permanently deleted and you have to click okay. But maybe that only applies to tracked files, not sure off the top of my head.