r/programming • • Jun 19 '14

Reinventing GIT interface

http://tonsky.me/blog/reinventing-git-interface/
221 Upvotes

325 comments sorted by

View all comments

Show parent comments

20

u/kankyo Jun 19 '14

The Right Thing should be easy. Dangerous things should be hard. Simple day-to-day operations should leave you in weird states for no obvious reason.

Git fails in this regard. I just found the subset of operations that I trust and never ever perform any operation outside that small list. Then I'm fine. That's not high praise for a tool imo.

2

u/cpbills Jun 19 '14

The Right Thing should be easy. Dangerous things should be hard.

A hammer is easily used to do dangerous things. Just because you want your tools to protect you from yourself doesn't mean that's the right approach.

git is a tool, and like all tools, there are right and wrong ways to use it. Learning how to use it prevents you from hurting yourself.

8

u/cjthomp Jun 19 '14

But a hammer isn't software. The person who builds a hammer can't also build in failsafes, checks, and safeguards.

That's kind of why software.

-2

u/cpbills Jun 19 '14

Sure you can. You could build a very complex and over-featured hammer with all sorts of safety mechanisms.

It wouldn't be a very useful tool then, though. Kind of like if git had all sorts of layers in place to protect the user.

-6

u/[deleted] Jun 19 '14

Um short of doing really stupid things like force pushing/etc you're never in unrecoverable state... for instance

git reset HEAD~ --hard

Oh noes how do I recover from that? Oh ya git reflog ... from that I can merge the commit back.

You can just as easily fuck up a CVS tree for instance

rm -f $CVSROOT/project/foo.c,v

Now that file has no history. It's just gone. bye bye.