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

2

u/[deleted] Jun 19 '14

Ya but "pretty" is relative. The way I have my .bashrc setup is probably different than yours. That's kinda the upside of the unix philosophy.

I mean unless you want to "OBEY" and have everyones workstation look exactly the same ala MacOS or Windows...

0

u/loup-vaillant Jun 20 '14

Ya but "pretty" is relative

Not always. There are objective criteria, such as orthogonality, size of the interface etc. that are very closely associated with the subjective impression of prettiness.

The grep and sed command for instance both use regular expressions. It would not be pretty of them to use different kinds of regular expressions: the effort I undertook to learn one command should be portable to the other. I was very happy to see how similar the two commands are. I was less happy to see that both grep and egrep existed, and to this day, I can't recall the differences of the top of my head.

Git on the other hand… What's up with being able to create a branch with both git branch and git checkout -b? That's… well, ugly. And it also means that millions of programmers will need to spend more time learning those commands. They will learn, but frankly, they shouldn't have to. I understand the need for short-cuts, but this is way overdone.

0

u/[deleted] Jun 20 '14

checkout -b is meant to move to the branch after making it. It's no more the "right" way to do it than

git branch foo && git checkout foo

So if you really can't remember the -b option then don't use it.

By this logic "gcc" is the most overloaded command in history... how do you assemble a .s file?

 gcc foo.s -o foo.o

How do you compile a c file?

gcc -c foo.c -o foo.o

How do you compile a C++ file?

gcc -c foo.C -o foo.o

... this is SO CONFUSING!!!

0

u/loup-vaillant Jun 20 '14

Well, there is a logic to it: those examples are all about generating an object file. There is something funny, though: I don't see any "-c" flag in your first example. It should be there to signal you want an object file, instead of a full executable. Did you forget it, or is it a genuine inconsistency with gcc?

I know what checkout -b is meant to do. The problem isn't that I can't remember what the command does. Man pages are enough for that. The problem isn't even that I can't remember how to create a branch, then move to it: 'cause if I can't remember the primary purpose of git branch and git checkout, I'm hopeless as a programmer.

There are two problems:

  1. It's one more option to document. It takes visual space, it takes time to read, and it doesn't help when you want to read anything else.

  2. It's surprising: checkout is supposed to have an effect on the working copy only. checkout -b also affects the repository.

I reckon it's not much. And I'm only a beginner, so this is the only example I can think of of the top of my head. But from the volume of complaints I hear about Git's user interface, I guess there are many other such examples. They add up.

0

u/[deleted] Jun 20 '14

You can fully use git as intended without ever doing "git checkout -b" ... that's the point. Sure it's odd that the checkout command can also create a branch but it's a useful shorthand since git is meant to be used with rapidly created branches.

1

u/loup-vaillant Jun 20 '14

You do not get my point. Even If I don't use that command it, that's a couple more lines in a documentation I often skim for other purposes. If it wasn't there, the rest would be that much easier to discover.

-1

u/[deleted] Jun 20 '14

Oh. my. god. That's horrible.

Now go read the RFC for X.509 and decipher that shit for me please.

Seriously, the git man pages read like easy bed time reading compared to some RFCs I have had to read.

What magical developers job do you hold where you don't have to read any specifications or standards ...

1

u/loup-vaillant Jun 20 '14

Oh. my. god. That's horrible.

More than your realize. This is not just Git. Our computers are more complex than they could have been by 3 or 4 orders of magnitude.

As for the RFCs… well many of them suck too. Maybe because the protocol sucks, or because the author just can't write. Either way, we could do better.

I will agree on one point: Git is not the worst. I'd even say it's fundamentally beautiful. It just wear horrible clothes at the moment.