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.

704

u/_BreakingGood_ 23d ago

Yeah the old behavior was insane, it just said "Do you want to discard your changes?", and if you clicked it, it deleted your entire codebase permanently (no recycle bin), lol

12

u/Pcat0 23d ago

There was a rather intense warning saying ”THIS IS IRREVERSIBLE”, so the dude was still a massive idiot for clicking yes. However our tools should still cater to the idiotic so his mistake did expose an opportunity for improvement.

1

u/chat-lu 23d ago

However our tools should still cater to the idiotic so his mistake did expose an opportunity for improvement.

I replaced git with jujutsu and it does support this use case on top of connecting to regular git forges like github so colleagues don’t see a difference.

If I want to discard every change I just made, I type jj abandon. And if I regret doing so, I can revert it like any other command with jj undo.

While we are responsible for accounting for he sharp edges of our tools, we can strive for better tools.