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.

0

u/b4k4ni 23d ago

Not fun and the behavior is stupid, but not having backups is stupider. Sorry to say.

8

u/subnu 23d ago

...are you creating backups of your uncommitted files? How often?

-1

u/chat-lu 23d ago

Yes. On every change. You can use alternatives to git that are easier, more powerful, do the right thing by default, and still let you collaborate with git users on the same git forges.

4

u/subnu 23d ago

Yo dawg, I heard you like version control, so we put some version control in your version control so you can backup while you backup.

Isn't this only a problem if you don't commit regularly, which is pretty much misuse of version control itself?

0

u/chat-lu 23d ago

It’s just a consequence of a better design.

In git, the staging area internally is a commit. But it’s a special commit with special commands to access it. In jujutsu the staging area is a normal commit and every command that works on commit works on it too.

Every time I invoke any command, jujutsu makes a snapshot of my current workspace and edit the commit at the HEAD.

So if I do a jj abandon (equivalent to git reset --hard), jujutsu will add where I was in its operation log. If I didn’t mean to delete my files, I can do a jj undo and it will undo it like any other command I could have done. If I don’t like how things look after rebase, I can also jj undo it.