327 points

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

permalink
report
reply
102 points

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

permalink
report
parent
reply
85 points

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.

permalink
report
parent
reply
26 points

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.

permalink
report
parent
reply
18 points

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.

permalink
report
parent
reply
10 points

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.

permalink
report
parent
reply
3 points

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

permalink
report
parent
reply
17 points

Those are rookie numbers. I have at least a 35k one somewhere. More than one actually.

People run their businesses on this.

permalink
report
parent
reply
6 points

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.

permalink
report
parent
reply
14 points
*
Removed by mod
permalink
report
parent
reply
12 points

He just heard monoliths were in again

permalink
report
parent
reply
6 points
*

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.

permalink
report
parent
reply
18 points

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

permalink
report
parent
reply
170 points
*

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

permalink
report
reply
127 points

Steps to Reproduce:

1.Go near this fucking shit editor.

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

🤣

permalink
report
parent
reply
91 points
  1. Ignore the scary warning VS Code shows you when you press the button.
permalink
report
parent
reply
110 points

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

permalink
report
parent
reply
14 points

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…”

permalink
report
parent
reply
9 points
*

4. Complain about lack of scary warning.

permalink
report
parent
reply
6 points

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

permalink
report
parent
reply
5 points

The dude ranted for awhile in the issue thread and closed the issue himself too! lol

permalink
report
parent
reply
6 points

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.

permalink
report
parent
reply
141 points

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.

permalink
report
reply
69 points

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

permalink
report
parent
reply
30 points

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

permalink
report
parent
reply
15 points

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.

permalink
report
parent
reply
3 points

“Discard” is not a git operation.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
9 points

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

permalink
report
parent
reply
2 points

Did you even read the thread?

permalink
report
parent
reply
3 points

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

permalink
report
parent
reply
42 points

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

permalink
report
parent
reply
3 points

Because “the underlying Git nukes them right away, so why shouldn’t we perma-delete the files, too?”

Anything else’d be effort…

permalink
report
parent
reply
8 points

Honestly it probably just runs the underlying git command

permalink
report
parent
reply
3 points

I wonder if there’s already a git extension to automatically stash the working tree on every clean/reset/checkout operation…

permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
-3 points
*

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.

permalink
report
parent
reply
7 points

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.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
0 points

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.

permalink
report
parent
reply
121 points

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

permalink
report
reply
66 points

im probably missing like one or two

commit. Lol

permalink
report
parent
reply
3 points

And mergetool ?

I don’t use push/pull btw.

permalink
report
parent
reply
17 points

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)

permalink
report
parent
reply
11 points

If I want to commit a selection of files, but not others, then I’m clicking boxes not typing filenames.

permalink
report
parent
reply
6 points

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

permalink
report
parent
reply
3 points

git add -p

permalink
report
parent
reply
2 points
*

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.

permalink
report
parent
reply
11 points

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

permalink
report
parent
reply
4 points

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.

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
2 points

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

permalink
report
parent
reply
3 points

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

permalink
report
parent
reply
16 points

You get pretty far with just clone, pull, add, commit, push

permalink
report
parent
reply
10 points

Checkout

permalink
report
parent
reply
10 points

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.

permalink
report
parent
reply
7 points

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.

permalink
report
parent
reply
6 points
*

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.

permalink
report
parent
reply
5 points

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.

permalink
report
parent
reply
2 points

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.

permalink
report
parent
reply
1 point

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.

permalink
report
parent
reply
1 point

Clone too 😁

permalink
report
parent
reply
66 points

Say you don’t know how to use git without saying you don’t know how to use git.

permalink
report
reply
27 points
*

That’s what happens when people stumble across that website called GitHub, get hooked and now have unrealistic expectations for the real git.

“I just installed Git for Windows. Where is the drag-to-upload box?”

— A statement dreamt up by the utterly deranged

Real git involves a lot of sweat, requires you to clean up any mess you make, and communicate with any partners about their preferred techniques instead of rawdogging it and waiting for issues. The pushing and pulling will come naturally but you need to know how and when to release, and be clear about how you wish to commit. Nightly is an option but good luck getting everyone on board. People might judge you for using the word “master” but it should be alright in private.

permalink
report
parent
reply
13 points

I’m literally a software dev working for a top company and I can barely use git on the CLI. I do all of my version control operations using a GUI, so there’s no sense in gatekeeping any of that. This is true of both my work projects and personal ones. It’s cool if you prefer the CLI, but it is absolutely not a required skill in order to have a successful and meaningful career.

permalink
report
parent
reply
16 points

I agree that the gatekeeping isn’t a good thing, but you should learn at least the basics of the CLI. It will give you a better understanding of what’s going on behind your GUI and makes troubleshooting and fixing problems a lot easier.

Definitely not required but it is absolutely a skill worth having.

permalink
report
parent
reply
1 point

It’s not even about the CLI. it’s about hygiene

permalink
report
parent
reply
8 points

People might judge you for using the word “master” but it should be alright in private.

I snorted. It was my inner 12-year-old’s fault. (Also because of recently some idiots getting up in arms about these terms in technology.)

permalink
report
parent
reply
1 point
*

“up in arms”:

Reality:
– “just don’t use them, some people find them offensive”
– “ok”

Anonymous techbros online:
“yOu CanT sAY aNYtHiNg ThEsE daYs”

permalink
report
parent
reply
5 points

involves a lot of sweat, requires you to clean up any mess you make, and communicate with any partners about their preferred techniques instead of rawdogging it and waiting for issues. The pushing and pulling will come naturally but you need to know how and when to release, and be clear about how you wish to commit. People might judge you for using the word “master” but it should be alright in private.

Don’t talk about my mom that way

permalink
report
parent
reply
16 points

Git doesn’t automatically recursively add all files in the directory to the repository though - VSCode decided that should be the default behavior, while other editors (intellij) ask if you want to add newly created files to version control

permalink
report
parent
reply
1 point
*

I just hate the vscode source control. It has always felt clunky and like it breaks things (or i just never figured out the workflow - either way i dont need it lol) It is way clearer to see what is happening the console

permalink
report
parent
reply
-2 points

That’s how git works. Every file and subfolder under the repo’s root folder belongs to the repo.

permalink
report
parent
reply
3 points

What does git add xxx do then

permalink
report
parent
reply
9 points

Alright you convinced me its time to pick up this skill. How does one best learn git? Just play around with it and break things?

permalink
report
parent
reply
7 points

That’s basically how I did it.

To properly learn it using this method, create a directory that contains only text files and sub directories and treat it like a real project. Add files, delete them, play around with updating the repository. Try and go back a few updates and see how the things react. Since it’s not a real project there’s no risk of loss, but you’ll still get to see the effects of what you do.

permalink
report
parent
reply
4 points

that’s a necessary step in your learning process, but certainly not sufficient. I’d recommend reading the book, since it shows in greut detail the inner workings of Git along with the basic concepts :

https://git-scm.com/book/en/v2

permalink
report
parent
reply
5 points

read the official book : https://git-scm.com/book/en/v2

permalink
report
parent
reply

Programmer Humor

!programmer_humor@programming.dev

Create post

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

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics

Community stats

  • 2K

    Monthly active users

  • 861

    Posts

  • 14K

    Comments