• katy ✨
    link
    fedilink
    1
    edit-2
    5 months 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

  • @[email protected]
    link
    fedilink
    English
    1505 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.

    • @[email protected]
      link
      fedilink
      English
      425 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

    • Scary le Poo
      link
      fedilink
      1
      edit-2
      5 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.

      • @[email protected]
        link
        fedilink
        English
        75 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
        link
        fedilink
        English
        25 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
          link
          fedilink
          15 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.

      • @[email protected]
        link
        fedilink
        395 months ago

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

        • @[email protected]
          link
          fedilink
          35 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.

          • @[email protected]
            link
            fedilink
            45 months ago

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

        • @[email protected]
          link
          fedilink
          155 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.

      • stebo
        link
        fedilink
        45 months ago

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

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

        • @[email protected]
          link
          fedilink
          95 months ago

          I remember following the drama back in the day. That warning you saw was the result of this now-classic bug report.

    • JackbyDev
      link
      fedilink
      English
      45 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.

    • @[email protected]
      link
      fedilink
      45 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.

  • Gamma
    link
    fedilink
    English
    215 months ago

    Screenshots of git issues are one of my favorite genres of meme

    • @[email protected]
      link
      fedilink
      English
      1275 months ago

      Steps to Reproduce:

      1.Go near this fucking shit editor.

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

      🤣

          • @[email protected]
            link
            fedilink
            English
            335 months ago

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

            • @[email protected]
              link
              fedilink
              English
              445 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.

          • @[email protected]
            link
            fedilink
            45 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.

            • @[email protected]
              link
              fedilink
              English
              14
              edit-2
              5 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.

            • @[email protected]
              link
              fedilink
              725 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.

              • @[email protected]
                link
                fedilink
                13
                edit-2
                5 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 out that whatever git may think, the user is about to lose some files.

              • EleventhHour
                link
                fedilink
                English
                12
                edit-2
                5 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.

              • @[email protected]
                link
                fedilink
                10
                edit-2
                5 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 deleting a tracked file, “Discard Changes” will restore it back.
                • If the change is a new untracked file, “Discard Changes” will remove it as intended.

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

                • @[email protected]
                  link
                  fedilink
                  75 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.

        • Miles O'Brien
          link
          fedilink
          English
          185 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…”

          • @[email protected]
            link
            fedilink
            English
            295 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.

              • @[email protected]
                link
                fedilink
                125 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.

              • @[email protected]
                link
                fedilink
                25 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.

              • @[email protected]
                link
                fedilink
                English
                65 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
                  link
                  fedilink
                  13
                  edit-2
                  5 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).

        • elgordino
          link
          fedilink
          75 months ago

          Pretty sure the scary warnings in big bold text are more recent than this report.

          • @[email protected]
            link
            fedilink
            English
            95 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!

    • Maven (famous)OP
      link
      fedilink
      65 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.

  • @[email protected]
    link
    fedilink
    85 months ago

    Fuck all victim-blamers. “Discard” is not how you label a button that permanently erases anything.

    • JackbyDev
      link
      fedilink
      English
      55 months 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.

      • @[email protected]
        link
        fedilink
        English
        35 months 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.

      • Vanshaj
        link
        fedilink
        45 months ago

        I once lost three hours of work early on during my learning, not much that I lost but it was a moment when I learnt a lesson. Never lost work after that ever.

  • @[email protected]
    link
    fedilink
    275 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.

    • @[email protected]
      link
      fedilink
      405 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.

      • @[email protected]
        link
        fedilink
        135 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.

        • @[email protected]
          link
          fedilink
          55 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.

        • @[email protected]
          link
          fedilink
          35 months ago

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

  • @[email protected]
    link
    fedilink
    14
    edit-2
    5 months 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…

    • Forbo
      link
      fedilink
      175 months ago

      Problem is, there’s an entire generation of users that have gotten super used to “discard changes” as a means of signalling “on second thought, don’t do anything”.

      • @[email protected]
        link
        fedilink
        English
        45 months ago

        That’s definitely how it is seen.
        If I were to see “Discard Changes” anywhere in a dialogue, I would assume it will discard whatever changes I made in that dialogue. In this case, probably some source control related changes. If it were to say “Warning: This will Discard ALL changes!!!”, I might do a double take, but had I never used git CLI before, I would still assume that at most it would discard “ALL” changes made in the current session.

        For me personally, I would consider it more useful for it to say:

        This action will delete the following files:
        - followed
        - by
        - a
        - list
        - of
        - files
        - that
        - would
        - be
        - deleted
        Continue?
        

        Which neither has to look like a warning, acting like you might be doing something you don’t want to and also is much more useful for someone like me who wants to double check what exactly I am deleting.


        Also, I have used git CLI before and apart from being able to see blame in the editor itself and maybe a better representation of tree, I don’t feel the need to use any git GUI tool. Even when I tried, I realised it was slower and more finicky to use. So, it would stand to reason that it should be targetted towards people who don’t use CLI (and might have never used git CLI).

      • @[email protected]
        link
        fedilink
        English
        25 months ago

        From a certain point of view - isn’t this exactly what happened here?

        I often go into a Git worktree of one of my projects and mess around a bit to try something out. If I find it’s not working, I tell git to discard the changes with git checkout . and git clean -df. What I’m saying is exactly “on second thought, don’t do anything" - while what happens in practice is that Git restores all files to their HEAD status and removes all the new files that are not already in HEAD.

        Of course, the difference is that I already have all the work I want to keep under source control, so these changes I’ve discarded really were that - just changes. He, on the other hand, “was just playing with the source control option” - so these “changes” he was discarding really were all his work. But Git did not know that.

    • @[email protected]
      link
      fedilink
      35 months ago

      This feels like when my brother backed up a file with Onedrive, then figured he could delete the original… the one that Onedrive was keeping track of.

      It’s not that these aren’t confusing, but why risk your file without testing what the software will do first? Especially before hitting anything like “delete” or “discard”?

      • @[email protected]
        link
        fedilink
        15 months ago

        See, that’s a mistake I could see myself making. I would just assume that OneDrive was making a backup, not tracking the file.

  • @[email protected]
    link
    fedilink
    75 months ago

    VS Code could really use some work in that regard and I really do feel bad for that person, but this is also just funny as heck

  • @[email protected]
    link
    fedilink
    English
    15 months ago

    “Microsoft Please Fix” ifadesi, genellikle kullanıcıların Microsoft ürünlerinde yaşadıkları sorunlara veya hata bildirimlerine yönelik bir çağrıdır. Tostçu Mahmut Menu

  • @[email protected]
    link
    fedilink
    155 months ago

    Man I get paranoid about synchronization programs for this very reason. There’s usually some turnkey easy-mode enabled as soon as you first launch that’s like:

    “Hey you wanna back up your entire NAS to your phone?! That’ll be fun, right?!”

    And you’re like “…No.”

    And then it wants to obliterate everything so it’s all “synchronized”, often it’s not easy to find a “No, stop, don’t do anything at all until I configure this.” Option.

    iTunes was SO BAD about this.

    Syncthing is the least-bad sync software I’ve ever run. It’s got some footguns but it’s still brilliant.

    I would imagine there’s still ways to back up version controlled software right?