863
submitted 1 day ago* (last edited 1 day ago) by Maven@lemmy.zip to c/programmer_humor@programming.dev
(page 3) 50 comments
sorted by: hot top controversial new old
[-] kamen@lemmy.world 4 points 15 hours ago* (last edited 15 hours ago)

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

[-] LANIK2000@lemmy.world 32 points 23 hours ago

Honestly no idea why someone would go around a completely unknown menu in a new unknown editor and randomly click things with caution completely out the window. Not having a copy or trying a blank project, not even reading any messages. I mean even if we don't know it's a nuke button, God knows what other edits it could do to your code without you knowing.

This goes beyond rookie mistake. This is something 12 year old me would do. Same with the issue page being 90% swear words.

[-] calcopiritus@lemmy.world 20 points 23 hours ago

I don't even know why people ITT are blaming the IDE and completely ignoring this.

When you learn git, you do so on a dummy project, that has 5 files which are 10 characters long each.

An IDE is not made so you can't break things, it is tool, and it should let you do things. It's like complaining that Linux will let you delete your desktop environment. Some people actually want to delete your desktop environment. You can't remove that option just because someone can accidentally do it by ignoring all the warnings.

[-] thebestaquaman@lemmy.world 16 points 22 hours ago

Got will not delete untracked files though, which is what happened here. If you want to discard changes to a file with git, you first have to commit the file to the index at some point, which means there's only ever so much damage an erroneous "git restore" or "git reset" can do. Specifically, neither of them will delete all the files in an existing project where VC has just been added.

[-] calcopiritus@lemmy.world 7 points 19 hours ago

This user was not using git though, he was using vs code. That button doesn't say "git reset" it says "discard all changes". And btw, what it does is "git clean", which is something that git can do.

Just below the button there is a list of all the changes. In his case, there were 3000 changes of the type "file creation". Discarding a file creation can only be made one way: deleting the file.

Anyway, this user is presumably in his learning phase, I would not assume that he knows what git reset or git restore actually do.

[-] thebestaquaman@lemmy.world 2 points 14 hours ago

Fair enough, git clean does exist. However, if the button saying "discard all changes" is really a button that runs git clean, that's just a plain terrible design choice. git clean is "delete all untracked files", which is specifically not discarding changes, because there can be no changes to discard on an untracked file. Even talking about "changes" to an untracked file in VC context makes little sense, because the VC system doesn't know anything about any changes to the file, only whether it exists or not.

That's not even mentioning the fact that the option to "git clean" shows up as one of the easily accessible options in relation to a staging process. Especially if you're coming from the git CLI, you're likely to associate "discard changes" with "git restore".

[-] Hawk@lemmy.dbzer0.com 5 points 18 hours ago

In other IDEs this discards tracked changes, untracked files usually stay untouched.

In my opinion, it's a combination of user error and bad implementation here

load more comments (2 replies)
load more comments (4 replies)
[-] Cethin@lemmy.zip 14 points 22 hours ago

This is a disease of GUIs. Most people are so used to having their hands held and being unable to make a mistake that when a GUI actually gives you the power to fuck up they don't expect it. I promise you, if this user was using the CLI, this wouldn't have happened as easily.

[-] Kbobabob@lemmy.world 7 points 18 hours ago

I promise you, if this user ~~was using the CLI~~ backed up their files, this wouldn't have happened ~~as easily~~.

load more comments (2 replies)
[-] JackbyDev@programming.dev 18 points 23 hours ago

Honestly no idea why editors give shit random names instead of using the terms git uses.

load more comments (1 replies)
[-] ICastFist@programming.dev 4 points 15 hours ago

Same account that complained about the christmas santa hat

load more comments (1 replies)
[-] Michal@programming.dev 5 points 16 hours ago

If the files were already staged then git should have blobs in the git folder, so they should be recoverable.

load more comments (7 replies)
[-] Korne127@lemmy.world 45 points 1 day ago

Poor guy basically did a git reset —hard HEAD without even a git repository

[-] GreenAppleTree@lemmy.world 11 points 19 hours ago

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

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

load more comments (1 replies)
[-] zarlin@lemmy.world 329 points 1 day ago

The real issue is already going 3 months without source control.

[-] Mixel@feddit.org 102 points 1 day 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 86 points 1 day 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 1 points 11 hours ago

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

load more comments (3 replies)
load more comments (6 replies)
load more comments (1 replies)
[-] mox@lemmy.sdf.org 169 points 1 day ago* (last edited 1 day ago)

In case anyone else is wondering, or simply doesn't like reading screen shots of text, this is apparently a real report:

https://github.com/microsoft/vscode/issues/32405

[-] eating3645@lemmy.world 125 points 1 day ago

Steps to Reproduce:

1.Go near this fucking shit editor.

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

🤣

load more comments (28 replies)
load more comments (1 replies)
[-] LengAwaits@lemmy.world 39 points 1 day ago

Looks like someone forgot about the 3-2-1 rule. Teachable moment.

load more comments (7 replies)
[-] Artyom@lemm.ee 24 points 1 day ago

If you ever happen to have 5000 uncommitted files, you shouldn't be asking yourself if you should commit more often. You should be asking yourself how many new repos you should be making.

[-] Korne127@lemmy.world 43 points 1 day 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.

load more comments (5 replies)
load more comments (2 replies)
load more comments
view more: ‹ prev next ›
this post was submitted on 20 Nov 2024
863 points (97.5% liked)

Programmer Humor

19623 readers
2031 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS