• Buddahriffic@lemmy.world
    link
    fedilink
    arrow-up
    14
    ·
    1 month ago

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

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

    • friendlymessage@feddit.org
      link
      fedilink
      arrow-up
      8
      ·
      1 month ago

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

      • BatmanAoD
        link
        fedilink
        arrow-up
        1
        ·
        1 month ago

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

    • GetOffMyLan
      link
      fedilink
      arrow-up
      4
      ·
      1 month ago

      My git gui has a tick box on that prompt to specifically include added files. I now see why haha

    • BatmanAoD
      link
      fedilink
      arrow-up
      2
      ·
      1 month ago

      Well, yeah, that’s why the linked ticket led to a massive improvement: