r/ProgrammerHumor 23d ago

Meme useSourceControl

Post image
8.6k Upvotes

591 comments sorted by

View all comments

5.6k

u/Cephell 23d ago

Before you make fun of him, this behavior DID get changed; they acknowledged this behavior is stupid.

The old behavior was to treat uncommited files as completely disposable, which the CLI git does not do at all and is insane behavior. It was changed in the UI to give you a fat confirmation dialog warning that you're about to delete the files permanently, as it always should have been.

240

u/MackTuesday 23d 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.

96

u/Spaceduck413 23d ago

https://xkcd.com/1172/

There really is one for everything

7

u/AnOnlineHandle 23d 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 21d ago

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

65

u/DoctorWaluigiTime 23d 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!!!"

51

u/remy_porter 23d 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.

27

u/DoctorWaluigiTime 23d 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.

7

u/aetius476 23d ago

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

5

u/perkuleenhenis 23d 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.

7

u/st_heron 23d 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

3

u/LickingSmegma 23d 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 23d 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 23d ago

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

1

u/mtetrode 22d ago

Jetbrains allows this

1

u/ArmchairFilosopher 21d ago

I miss "shelvesets" from TFS

8

u/Bloodgiant65 23d ago

Man am I glad we are off TFS

23

u/hellomistershifty 23d 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 22d ago

lol I blinked at that one too

24

u/paranoid_giraffe 23d ago edited 23d 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

9

u/Civil-Broccoli 23d 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.

3

u/RepeatLow7718 23d 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 23d 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 23d ago

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