• Phoenix3875@lemmy.world
    link
    fedilink
    arrow-up
    36
    ·
    2 days ago

    Reminds me of a hilarious bug in early GHC: https://gitlab.haskell.org/ghc/ghc/-/issues/163

    The compiler will delete your source file if there’s any compile error. And the user complained only by sending a very polite email to report this bug. Simon Peyton Jones mentioned it in one of his talks and I still find it quite hilarious till this day.

  • MystikIncarnate@lemmy.ca
    link
    fedilink
    English
    arrow-up
    21
    arrow-down
    3
    ·
    2 days ago

    While I have some sympathy for anyone who loses months of work, as an IT administrator by day, all I have to say about their lack of backups, and lack of RTFM before messing with shit is:

    HAHAHAHAHAHAHA HAHAHAHAHA. you got what you deserved fucker. GL.YF.

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      17
      arrow-down
      1
      ·
      2 days ago

      Go read the actual thread. There was a bug someone found that files you have in there that aren’t even associated with git still get deleted. I’m not entirely convinced this was the poster’s fault.

      • zalgotext@sh.itjust.works
        link
        fedilink
        arrow-up
        3
        arrow-down
        8
        ·
        2 days ago

        If you use git and understand that VSC’s source control stuff is just a thin wrapper around git, you should understand what “discard all changes” means

      • bitwolf@sh.itjust.works
        link
        fedilink
        English
        arrow-up
        3
        arrow-down
        7
        ·
        edit-2
        2 days ago

        I just tried right now to get the exact message.

        Are you sure you want to DELETE foo?
        This is IRREVERSIBLE!
        This file will be FOREVER LOST if you proceed.

        The confirmation button even says Delete File

        User error.

    • SPRUNT@lemmy.world
      link
      fedilink
      arrow-up
      1
      arrow-down
      4
      ·
      2 days ago

      Man who clicks confirmation for leopards to delete his work is angry and surprised when his work is deleted.

  • _____@lemm.ee
    link
    fedilink
    English
    arrow-up
    124
    arrow-down
    2
    ·
    2 days ago

    let’s turn this into a constructive angle for future devs and current juniors: just learn git cli, I promise you it is much simpler than it seems.

    all those memes about git having like a thousand commands are true, but you really will only use like 7 at most per month.

    learn push, pull, merge, squash, stash, reset, im probably missing like one or two

    I promise you again: it is much simpler than it seems. and you won’t have to use these stupid git GUI things, and it will save you a hassle because you will know what commands you are running and what they do

    short disclaimer: using git GUI is totally fine but low-key you are missing out on so much

    • MajorasMaskForever@lemmy.world
      link
      fedilink
      English
      arrow-up
      19
      arrow-down
      1
      ·
      2 days 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)

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

      • Antiproton@programming.dev
        link
        fedilink
        arrow-up
        13
        arrow-down
        1
        ·
        2 days ago

        The difference in speed is familiarity, not some inherent efficiency gain by typing commands into the cli.

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

      • _____@lemm.ee
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 days 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
        arrow-up
        6
        ·
        2 days 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
          arrow-up
          3
          ·
          2 days 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
          arrow-up
          2
          ·
          edit-2
          2 days 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.

    • Piatro@programming.dev
      link
      fedilink
      English
      arrow-up
      11
      ·
      2 days ago

      The main draw to the CLI for me is portability. I’ve been a dev for ten years now and used tons of different editors on different platforms and while each one had a different way to describe the changes, how to commit, or how to “sync” (shudder), the CLI hasn’t changed. I didn’t have to relearn a vital part of my workflow just because I wanted to try a different editor.

    • Atlas_@lemmy.world
      link
      fedilink
      arrow-up
      9
      arrow-down
      1
      ·
      2 days 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.

    • Cethin@lemmy.zip
      link
      fedilink
      English
      arrow-up
      7
      ·
      edit-2
      2 days ago

      Personally, I’m pretty good with the CLI version, but sometimes I just use the Code VC interface. For some tasks (basic commit, pull, push) it’s pretty fast. I don’t know if it’s faster than CLI, but I switch between them depending on what I’m doing at that moment. Code has a built in console, so using either is pretty seemless and easy. If you only use the GUI you won’t ever understand it though. I think everyone should start with CLI.

      Honestly, this is true for almost everything. GUIs obfiscate. They don’t help you learn, but try to take control away so you can’t mess up, and as an effect can’t do everything you may want.

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

    • CodeMonkey@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      For me, it is easier to learn to use git via CLI instead of a UI. When I first started using git, I learned a few command/flag combinations that I use every day and I barely learned anything else about git after. Everything I don’t do regularly I don’t remember, but have written down in a text file of incantations. It is harder to write down what buttons and what menus I have to click.

    • apostrofail@lemmy.world
      link
      fedilink
      arrow-up
      8
      arrow-down
      7
      ·
      2 days 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.

      • Reil@beehaw.org
        link
        fedilink
        English
        arrow-up
        3
        ·
        2 days ago

        Yeah, those are novice numbers. I have infinite backups of my 0 files!

      • Vanshaj@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2 days 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.

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      ·
      2 days ago

      And they were trying to correct their priorities by looking into the source control features, so I don’t see how that’s anything other than victim blaming for them not doing it sooner.

      • MystikIncarnate@lemmy.ca
        link
        fedilink
        English
        arrow-up
        2
        arrow-down
        2
        ·
        2 days ago

        I would argue that it’s common sense to at least make a point in time copy, to… IDK, a USB drive? Before trying to implement a new source/control system.

        Just plug in an external drive, or a thumb drive, copy/paste, unplug it, then proceed with testing.

        I don’t see how anyone who values their time and effort could do any less.

        As for the files, undelete is a thing, and it shouldn’t be hard to do.

  • MonkeMischief@lemmy.today
    link
    fedilink
    arrow-up
    14
    ·
    2 days 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?

  • AusatKeyboardPremi@lemmy.world
    link
    fedilink
    arrow-up
    41
    arrow-down
    1
    ·
    edit-2
    2 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.

    • Traister101@lemmy.today
      link
      fedilink
      arrow-up
      4
      ·
      edit-2
      2 days ago

      JetBrains has really nice Git integration. Interactive rebaseses and merges are quite pleasant but I’m still dipping into the command line to do stuff occasionally. Most commonly a git reset HEAD~ cause I want to split a commit though I had to dig through the reflog the other day cause I suddenly realized I lost an important branch that ended up being over a hundred commits back.

    • BehindTheBarrier@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      2 days ago

      How do you view diffs and merges when you say you don’t use git GUIs? External tool or terminal/command line?

      I use Jetbrains IDEs and most of my life has been IDE based git interaction. And I honestly love it, easy access to see my diffs, the most common commit, push and stage(or shelve as Jetbrains does it, which is better than visual studio). Hassle free and available beats writing anything to me.

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

        How do you view diffs and merges when you say you don’t use git GUIs? External tool or terminal/command line?

        Terminal.

        I use Jetbrains IDEs and most of my life has been IDE based git interaction. And I honestly love it, easy access to see my diffs, the most common commit, push and stage(or shelve as Jetbrains does it, which is better than visual studio). Hassle free and available beats writing anything to me.

        Perhaps, it is a mix of learned behaviour and cognitive fixation, as I started out my development journey predominantly using a terminal, that I cannot fathom Git GUI being hassle free.

        Nice to read a different perspective on such a fundamental thing that I take for granted while working. Thank you for sharing it.

  • AnAmericanPotato@programming.dev
    link
    fedilink
    English
    arrow-up
    149
    arrow-down
    5
    ·
    2 days ago

    I feel bad for this kid. That really is a bad warning dialog. Nowhere does it say it’s going to delete files. Anyone who thinks that’s good design needs a break.

    Half the replies are basically “This should be obvious if your past five years of life experience is similar to mine, and if it isn’t then get fucked.” Just adding insult to injury.

    • Omega_Jimes@lemmy.ca
      link
      fedilink
      arrow-up
      74
      arrow-down
      2
      ·
      2 days ago

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

      • Michal@programming.dev
        link
        fedilink
        arrow-up
        39
        arrow-down
        9
        ·
        2 days 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
          15
          ·
          2 days 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
          4
          arrow-down
          1
          ·
          2 days ago

          Ok fair enough, but I’m under the impression these files existed before the source control was implemented.

          I guess it’s all up to how the program handles existing files.

          • FiskFisk33@startrek.website
            link
            fedilink
            arrow-up
            4
            ·
            2 days 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
        7
        arrow-down
        2
        ·
        2 days ago

        I’m pretty sure vscode shows a confirmation dialog when discarding changes will permanently delete a file. I’ve done that recently with temporary files that were no longer needed.

      • stebo@lemmy.dbzer0.com
        link
        fedilink
        arrow-up
        4
        arrow-down
        1
        ·
        2 days ago

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

    • cocobean@bookwormstory.social
      link
      fedilink
      English
      arrow-up
      43
      ·
      2 days ago

      Also, why not send them to the recycle bin? I never really thought about it before, but that does seem a reasonable UX improvement for this case

    • JackbyDev@programming.dev
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 days ago

      It’s so fucking infuriating that so many devs act like this. “This should’ve been obvious!” Fuck off, that’s an unhelpful statement. “You should’ve been using version control! No backup, no sympathy!” Fuck off, they were literally trying to begin using version control for backups.

      Even half the comments on this very Lemmy thread are disparaging this dev. I wonder how many actually read the thread and found that there was a bug discovered causing this feature to delete files not even associated with git?

      But, congratulations to them, I suppose. Congratulations on making fun of someone. I hope it makes them feel powerful. 🙄 Devs can be so toxic.

    • kehet@sopuli.xyz
      link
      fedilink
      arrow-up
      6
      arrow-down
      1
      ·
      2 days ago

      Came here to say this. No one deserves this, not even new programmers who try to learn things.

      Some programming tools are really powerful compared to what new users are used to. If you come from the world of Microsoft Office and Apple whatever it’s called, everything is saved automatically to cloud and there is some local backup file somewhere which you can just restore. Modern programs are designed to protect users against their own mistakes, and when suddenly that is taken away, it can be a jarring experience.

    • Scary le Poo@beehaw.org
      link
      fedilink
      arrow-up
      1
      arrow-down
      4
      ·
      edit-2
      2 days ago

      If you’re going to use a git tool, you need to know how git works.

      There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?

      No sympathy. Dude is a shit developer and he learned an invaluable lesson.

      • AnAmericanPotato@programming.dev
        link
        fedilink
        English
        arrow-up
        6
        ·
        2 days ago

        My guess is that this is a teenager, and this is probably their first experience with git and version control in general. Just a hunch.

        Anyway, it is reasonable to expect a mainstream GUI app from one of the largest companies in the world to be approachable for people who do not know all the inner workings of the command line tools that are used behind the scenes. And it is reasonable to expect any destructive action to have clear and bold warnings. “Changes will be discarded” is not clear. What changes? From the user’s perspective, the only changes were regarding version control, so “discarding” that should leave them where they started — with their files intact but not in version control.

        Have mercy on the poor noobs. We were all there once.

      • JackbyDev@programming.dev
        link
        fedilink
        English
        arrow-up
        2
        ·
        2 days ago

        If you’re going to use a git tool, you need to know how git works.

        I guarantee you at least half of git users would get glossy eyes as soon as you mention blobs and trees, yet they all still manage to use it daily successfully.

        There are 0 excuses for not having months of work in a repo, none. I have no sympathy whatsoever. How the fuck do you spend so many months without backing up your project or stuffing it in a repo?

        I need you to listen to me very carefully: THEY WERE FUCKING SETTING UP A REPO WHEN THIS HAPPENED.

        • Scary le Poo@beehaw.org
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          1 day 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.

    • Mixel@feddit.org
      link
      fedilink
      English
      arrow-up
      102
      ·
      3 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
        86
        ·
        3 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.

        • RagingRobot@lemmy.world
          link
          fedilink
          arrow-up
          25
          ·
          2 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.

        • MajorHavoc@programming.dev
          link
          fedilink
          arrow-up
          17
          ·
          2 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.

        • LANIK2000@lemmy.world
          link
          fedilink
          arrow-up
          9
          ·
          2 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.

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

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

      • Blackmist@feddit.uk
        link
        fedilink
        English
        arrow-up
        16
        ·
        2 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
          5
          ·
          2 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
            6
            ·
            2 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
        5
        ·
        edit-2
        2 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.

    • Korne127@lemmy.world
      link
      fedilink
      arrow-up
      19
      arrow-down
      1
      ·
      2 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

  • DelightfullyDivisive@lemmy.world
    link
    fedilink
    English
    arrow-up
    27
    arrow-down
    14
    ·
    2 days ago

    I’m sure that the “three months of work” was completely shit code. Anybody who is unfamiliar with source control (or even backups!) is prone to making stupid mistakes. Republican voters are likely to have a similar experience over the next 4 years.

    • eating3645@lemmy.world
      link
      fedilink
      English
      arrow-up
      125
      ·
      3 days 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
          114
          arrow-down
          5
          ·
          3 days ago

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

          • bleistift2@sopuli.xyz
            link
            fedilink
            English
            arrow-up
            31
            ·
            3 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
              40
              ·
              2 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.

          • josefo@leminal.space
            link
            fedilink
            arrow-up
            4
            arrow-down
            3
            ·
            2 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
              14
              ·
              edit-2
              2 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.

            • Hawke@lemmy.world
              link
              fedilink
              arrow-up
              71
              arrow-down
              3
              ·
              3 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.

              • MajorHavoc@programming.dev
                link
                fedilink
                arrow-up
                14
                arrow-down
                1
                ·
                edit-2
                2 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 out that whatever git may think, the user is about to lose some files.

              • EleventhHour@lemmy.world
                link
                fedilink
                English
                arrow-up
                12
                arrow-down
                1
                ·
                edit-2
                3 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.

              • Pyro@programming.dev
                link
                fedilink
                arrow-up
                10
                arrow-down
                7
                ·
                edit-2
                3 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 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”.

                • candybrie@lemmy.world
                  link
                  fedilink
                  arrow-up
                  8
                  ·
                  2 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.

        • Miles O'Brien@startrek.website
          link
          fedilink
          English
          arrow-up
          18
          arrow-down
          4
          ·
          3 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
            30
            ·
            3 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.

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

              • bamboo@lemmy.blahaj.zone
                link
                fedilink
                English
                arrow-up
                6
                arrow-down
                3
                ·
                2 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
                  14
                  ·
                  edit-2
                  2 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).

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

        • elgordino@fedia.io
          link
          fedilink
          arrow-up
          7
          arrow-down
          1
          ·
          3 days ago

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

          • PostingPenguin@feddit.org
            link
            fedilink
            English
            arrow-up
            9
            arrow-down
            1
            ·
            3 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!

      • Lazycog@sopuli.xyz
        link
        fedilink
        arrow-up
        6
        arrow-down
        1
        ·
        3 days 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
      7
      ·
      3 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.

  • mvirts@lemmy.world
    link
    fedilink
    arrow-up
    39
    ·
    2 days ago

    Obligatory mention of file recovery as an option if you get in this situation.I recommend testdisk but there are other more gui friendly options.

    NTFS takes a relatively long time to destroy the data so chances of recovery are good on Windows.