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

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

  • AnUnusualRelic@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    12 days ago

    Looks like windows should come with a dictionary.

    “Huh, discard, I wonder what that does. Let’s try it on all my work from the last six months”

    Idiots gonna idiot…

    • Korne127@lemmy.world
      link
      fedilink
      arrow-up
      0
      ·
      13 days 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
      0
      ·
      13 days 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

      • e8d79@discuss.tchncs.de
        link
        fedilink
        arrow-up
        0
        ·
        13 days 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.

        • AlexWIWA@lemmy.ml
          link
          fedilink
          English
          arrow-up
          0
          ·
          12 days ago

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

        • RagingRobot@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          13 days 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.

        • LANIK2000@lemmy.world
          link
          fedilink
          arrow-up
          0
          ·
          12 days 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.

        • MajorHavoc@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          13 days 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.

      • Blackmist@feddit.uk
        link
        fedilink
        English
        arrow-up
        0
        ·
        13 days 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
          0
          ·
          12 days 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
            0
            ·
            12 days 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
        0
        ·
        edit-2
        12 days 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.

  • BougieBirdie@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    13 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.

    • Beacon@fedia.io
      link
      fedilink
      arrow-up
      0
      ·
      13 days ago

      I don’t know anything about programming, i came here from /all, but it seems to me that a command that’s this permanently destructive warrants a second confirmation dialog message reminding the user that the files will be permanently deleted and not undoable

      • CaptDust@sh.itjust.works
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        They clicked discard changes, confirmed it, and the computer did as instructed. This operation is normally not so destructive as it only discards uncommitted changes to realign the local directory with the remote server. Unfortunately for user, it sounds like they have never committed a change, so realignment meant reverting to an empty folder.

      • ArbiterXero@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        The problem is that these are “source control basics” that everyone needs to learn the hard way once it seems.

        Waiting 3 months in between commits however is a really bad rookie mistake because you were worried about making a commit that wasn’t perfect.

        • tyler@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          13 days ago

          the problem is that VS Code ran git clean if you clicked yes, which is completely idiotic behavior. No other git client, text editor, or IDE on the planet does that.

          • MajorHavoc@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            13 days ago

            Interesting. I wouldn’t know, because I code everything perfectly the first time.

            Disclaimer: The above flagrant lie was brought to you by my also using rebase and squash to hide all of my mistakes.

        • Semi-Hemi-Lemmygod@lemmy.world
          link
          fedilink
          English
          arrow-up
          0
          ·
          13 days ago

          That’s not a very good dialog box. He didn’t make any changes, so discarding them doesn’t sound like a problem.

          There should be a notice when you enable source control that this will permanently delete all existing files with a checkbox (checked by default) that says “Add existing files to source control.”

          • Pyro@programming.dev
            link
            fedilink
            arrow-up
            0
            ·
            13 days ago

            He wouldn’t have seen the “Discard Changes” button at all if source control wasn’t already setup (and detected by VSCode).

            No program will delete files either when you initialize source control.

            • LordPassionFruit@lemm.ee
              link
              fedilink
              arrow-up
              0
              ·
              13 days ago

              My sibling ran into this issue once. I’m not sure if it’s a setting or a default, but vscode would assume they were working in a blank repo until they made a commit.

              Sounds like this person had the project (without source control) in another IDE, tried out VSCode, and it assumed that it was all ‘changes’. I don’t use VSCode, do I can’t say for certain, but I know my sibling lost ~4 hours of project set up for the same reason (though they immediately realized it was their fault).

              • Pyro@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                13 days ago

                Reading your comment and #32459, I realize that VSCode source control did have some major issues back then.

                It looks like they have improved though, as the latest VSCode I use doesn’t auto-initialize repositories anymore.

        • Beacon@fedia.io
          link
          fedilink
          arrow-up
          0
          ·
          13 days ago

          Hm ok yeah, that seems quite scary sounding so that i would strongly hesitate before clicking on “discard ALL changes”. Still, I wonder if a second confirmation dialog with more information is warranted for a command that’s so destructive.

          • TeamAssimilation@infosec.pub
            link
            fedilink
            arrow-up
            0
            ·
            13 days ago

            I guess cancelling would go back to the “Then you want to commit all files?” dialog, which the user didn’t want to, he just wanted to cancel whatever the IDE was trying to start.

            • subignition@fedia.io
              link
              fedilink
              arrow-up
              0
              ·
              13 days ago

              It’s changes from the prior commit in the repository, which, if they had not committed anything prior, would have been an empty directory.

              This is perhaps a good lesson in teaching version control as its own concept rather than “streamlining it” by bundling it with an editor.

              • Scubus@sh.itjust.works
                link
                fedilink
                arrow-up
                0
                ·
                13 days ago

                Ok then, the changes to the repository shouldve been discarded. Anything he uploaded shouldve been deleted from the server. Why were files on his local machine deleted?

                • subignition@fedia.io
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  13 days ago

                  What makes you think a server was involved here? It was a local repository, evidenced by the reporter’s bewilderment that files can be deleted without going to the Recycle Bin first. Which tells us that in addition to VCS, they were unfamiliar with Windows as well.

              • conciselyverbose@sh.itjust.works
                link
                fedilink
                arrow-up
                0
                ·
                13 days ago

                You shouldn’t be taking ownership of files and then deleting them without communication a hell of a lot better than that.

                I understand what happened. I’m saying that if you’re going to delete stuff that was there before the software was, your flow to adding a project should include suggesting a base level commit of everything that’s there already.

                • subignition@fedia.io
                  link
                  fedilink
                  arrow-up
                  0
                  ·
                  13 days ago

                  That’s definitely fair, creating a repository in a non-empty directory could definitely suggest auto-committing the current state if it doesn’t already. I don’t use VSCode so I wouldn’t know.

                  Although now that I think about it, that could have been the intention here but not automatic, if that’s why 5k+ files were staged without the user explicitly staging them. Extra tragic if that’s the case.

            • mark3748@sh.itjust.works
              link
              fedilink
              arrow-up
              0
              ·
              13 days ago

              Then you don’t understand git or source control in general. If you don’t commit your changes, then you discard any changes, you’re set back to the last commit. Discarding changes also includes any un-committed new files.

              • onlinepersona@programming.dev
                link
                fedilink
                English
                arrow-up
                0
                ·
                13 days ago

                Which is exactly the situation the dude was in. As a newbie, it’s an easy mistake to make. Telling somebody who doesn’t know “well, would you look at that, you didn’t know!” is not just unhelpful, it’s useless and condescending.

                Anti Commercial-AI license

              • tyler@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                13 days ago

                discarding changes does not discard uncommitted new files. The VS Code button did a git clean which is completely unexpected. Git even refers to a git clean with completely different terminology.

                git reset -> “Resets the index and working tree. Any changes to tracked files in the working tree since are discarded.

                git clean -> “Cleans the working tree by recursively removing files that are not under version control, starting from the current directory.”. This command also requires you to specify a force option to actually do something, else it quits with an error.

                Note that git clean never once refers to discarding anything, and git reset never refers to removing untracked files. VS Code was doing an idiotic thing. Running git reset --hard AND git clean. There is absolutely no reason to be running git clean from an UI button ever. If you want to remove a file you can explicitly remove it.

                Imagine that the button said “Discard all changes” and then it ran rm -rf --no-preserve-root /*. Would that make sense as a button? No. It definitely would not.

            • Pyro@programming.dev
              link
              fedilink
              arrow-up
              0
              ·
              13 days ago

              It’s not that. It means discard all changes made after the last change committed to this local repository.

      • Starbuck@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        I think it’s important to know that this program is for code developers, and the issue here is with a tool called git. Git is like file saving on steroids, because on top of saving a single file, you save many changes to files in git, add a comment for why you made those changes, and share your changes across dozens of files with other developers.

        What this guy did was develop for many months after starting to use git, but he never actually committed the files. Then he asked for to reset everything back to the original state, something that I do multiple times a day, and it gave him a warning that original means original and you will lose everything. And he said do it anyways.

        • tyler@programming.dev
          link
          fedilink
          arrow-up
          0
          ·
          13 days ago

          No he asked for a discard after importing the project into VS Code. discard in git terms refers to git reset, not git clean. Even if he wanted to run a git reset then this version of VS Code would have run a git clean and deleted everything. Imagine he committed all 5000 files, but had a secret.json that he hadn’t committed. He didn’t add it to gitignore either. Running a git reset --hard will not delete this file, but the VS Code button did exactly that because it ran a git clean.

      • InternetCitizen2@lemmy.world
        link
        fedilink
        arrow-up
        0
        ·
        13 days ago

        Perhaps. Still I am not sure why someone who is not aware of this would be using VSC. If they are a student then what kind of project are they working on that they have so many files?

  • AusatKeyboardPremi@lemmy.world
    link
    fedilink
    arrow-up
    0
    ·
    edit-2
    12 days ago

    I always found Git GUIs, especially the ones built into IDEs, to be more confusing and clunkier than working with Git on a terminal. It often feels like unlearning what one knows about Git, and relearning it the way that specific GUI demands.

    Heck, I am going through the aforementioned feeling as I force myself to use Magit on Emacs. It just does not feel intuitive. But I will not give up until I have made an honest and full attempt.

    The only sensible Git GUI I ever used is Sublime Merge[0], after a coworker praised it immensely. Even that is reserved for the rarest of the rare times when the changes in the workspace gets unwieldy and unruly. For every other instance: Git CLI on a terminal.

    [0] https://www.sublimemerge.com/

    E: typo, and link to mentioned GUI.

    • eating3645@lemmy.world
      link
      fedilink
      English
      arrow-up
      0
      ·
      13 days ago

      Steps to Reproduce:

      1.Go near this fucking shit editor.

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

      🤣

        • Miles O'Brien@startrek.website
          link
          fedilink
          English
          arrow-up
          0
          ·
          13 days 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
            ·
            13 days 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
                ·
                13 days 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
                  13 days 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).

              • MajorHavoc@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                13 days 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.

              • Scoopta@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                13 days 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.

            • Hawke@lemmy.world
              link
              fedilink
              arrow-up
              0
              ·
              13 days 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
                13 days 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
                  ·
                  13 days 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.

              • MajorHavoc@programming.dev
                link
                fedilink
                arrow-up
                0
                ·
                13 days 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.

              • EleventhHour@lemmy.world
                link
                fedilink
                English
                arrow-up
                0
                ·
                edit-2
                13 days 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.

          • josefo@leminal.space
            link
            fedilink
            arrow-up
            0
            ·
            13 days 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
              0
              ·
              edit-2
              13 days 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.

          • bleistift2@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            0
            ·
            13 days 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
              0
              ·
              13 days 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.

          • PostingPenguin@feddit.org
            link
            fedilink
            English
            arrow-up
            0
            ·
            13 days ago

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

            It’s quite the fun read!

    • Maven (famous)@lemmy.zipOP
      link
      fedilink
      arrow-up
      0
      ·
      13 days 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.

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