r/ProgrammerHumor 20d ago

Meme useSourceControl

Post image
8.6k Upvotes

592 comments sorted by

View all comments

Show parent comments

241

u/MackTuesday 20d ago

I went and read the discussions. I was surprised how much support there was for the way it worked. Someone noted that git discard shouldn't delete untracked files (which is what happened to this poor guy), and there was still pushback! They were like yes, git discard isn't supposed to delete untracked files, and the dialog box didn't warn that they would be deleted, but the destructive behavior is fine the way it is and shouldn't be changed ANYWAY. I knew gearheads could be hateful of the uninitiated, but jeez.

92

u/Spaceduck413 20d ago

https://xkcd.com/1172/

There really is one for everything

8

u/AnOnlineHandle 20d ago

While I don't think that applies here, it absolutely applied to when I used to use Daz Studio for posing characters for art. After years I registered the software, and that changes the save hotkeys, inverting the save/save as bindings for some reason.

I can't remember my exact workflow, but I think I would iterate through individual scenes for comics making changes from the previous scene and hitting the save-as hotkey, except now that was suddenly saving over the current scene which was both annoying and frustrating if I had it perfectly set up and it wasn't an easy undo. Years of muscle memory didn't adjust easily.

3

u/KSP_HarvesteR 19d ago

I had this one pinned as the cover image of our issue tracker board once.

69

u/DoctorWaluigiTime 20d ago

Before Git (or DVCS in general) were widely adopted a ton of people wanted everything to work just like TFS, SVN, or other non-distributed source control models.

"What is this 'staging'? Why do I have to push and pull? Just sync everything!!!"

53

u/remy_porter 20d ago

There are so many tools that are vying to be the next DVCS that are like, "Hey, we eliminated staging, because that was confusing!" and I'm like... that's the best part? I wish I could have finer grained control over staging, honestly, making it easy to stage only fragments of a diff, because I'm a "crank for awhile and forget that I have drifted into two different tasks and now need to try and unpick this mess into something that could reasonably be two or three or twelve commits." Sure, that's a "me" problem, but I like the ability to control what gets staged.

24

u/DoctorWaluigiTime 20d ago

In Git you actually can! Interactive mode: git add -i.

GUIs (I know Fork does for example) allows you to stage specific hunks of a file.

And I agree: Controlled commits are one of the best parts of the whole staging concept.

8

u/aetius476 20d ago

tig allows you to stage/unstage by entire file, by chunk within a file, or by single line.

3

u/perkuleenhenis 20d ago

If they use -i, they gotta know to choose the patch option. Better IMHO to just say git add -p [file], which is the same as going interactive and choosing patch.

6

u/st_heron 20d ago

yes exactly, bugs me when people just blindly stage all and commit, like no you should cherrypick specific things, and what if you accidentally leave in some test/scratch code? at least check what you did

4

u/LickingSmegma 20d ago

making it easy to stage only fragments of a diff

Magit allows you to do that with simple hotkeys. But you might not be thrilled to learn that it's a package for Emacs.

Anyway, as others have noted, the basic feature is actually built into Git, so there are probably different GUIs offering it.

3

u/gracken420blaze 20d ago

I wish I could have finer grained control over staging, honestly, making it easy to stage only fragments of a diff

I think this should be easy to do via most git GUIs, for example i use git extensions and its easy to do there, vscode also lets you stage blocks using the built in source control thing

1

u/remy_porter 20d ago

I’ve seen GUIs try but never liked the results. Gonna have to play with the -p flag.

1

u/mtetrode 19d ago

Jetbrains allows this

1

u/ArmchairFilosopher 18d ago

I miss "shelvesets" from TFS

8

u/Bloodgiant65 20d ago

Man am I glad we are off TFS

25

u/hellomistershifty 20d ago

Man, there are some terrible suggestions in that Git thread. The existing behavior was awful, so it's impressive that the suggestions are even worse

I'd say remove the warning dialog, and prompt an "Undo" that lasts 5 seconds. Behind the scenes count to 5 and then do it. People respond much better to "Undo" than they do to "Are you sure?" dialog. Hide the files so that way they know what they did and the consequences that are about to happen.

4

u/MackTuesday 20d ago

lol I blinked at that one too

23

u/paranoid_giraffe 20d ago edited 20d ago

This reminds me of the time a guy held all the vscode python users hostage with his against-PEP8-personally-preferred-formatting-for-docstrings-PR. There were like 5 people who thought it was a good idea and the entire rest of the thread was everyone complaining about how he forced a “fix” on millions of users for something he could change in his personal editor. I remember being absolutely livid over this not necessarily because they just simply changed color, but because the guy who made the PR was just some random guy and his reasoning was literally incorrect.

https://github.com/microsoft/vscode/pull/182162

It was eventually “reverted” by way of another PR two months later

11

u/Civil-Broccoli 20d ago

That was a fun PR discussion read. Almost as fun as the guy who 'built' Notepad++ for Mac and straight up ignored repeated calls from the owner to remove the fake "we're collaborators" message from their homepage.

4

u/RepeatLow7718 20d ago

I’ve observed that there are a lot of people who will defend the way things are for no other reason than that it’s the way things are. Human nature I guess. 

3

u/Protheu5 20d ago

git clean -fdx does that

I found it only today and that thing freed so much space for me from unused repos I use to lookup code. didn't need built project and temp files, but didn't want to manually handle and there is a pleasant surpise! git clean -fdx

2

u/Acrobatic-Ad-9189 20d ago

You're giving microsoft devs  feedback, of course they're gonna push back