GIT sucks

I do not like git.

Let’s take the most mind-numbingly trivial of operations, I want to put a branch I have somewhere so somebody else can get it.  That’s the whole point of distributed revision-control, collaboration.

That’s too fundamental to be covered in the git tutorial, after all, it wouldn’t be fun if it were that easy.

Happily, git has built in manual pages.  And knowing a few other revision control systems, we can guess that the command might be push.  And indeed, there’s a push command:

   push       Update remote refs along with associated objects

Maybe this isn’t going to be so hard after all, a quick git push –help and we’ll be laughing.

DESCRIPTION
Updates remote refs using local refs, while sending objects necessary
to complete the given refs.

Ok, err, not quite sure what that means; but it sounds like it’s doing something over there with what I have here.  Probably the tool I want.

You can make interesting things happen to a repository every time you
push into it, by setting up hooks there. See documentation for git-
receive-pack(1).

I’m not sure I want to know about making interesting things happen right now, I’ll just settle for some boring making-things-public.

OPTIONS
<repository>
The “remote” repository that is destination of a push operation.
See the section GIT URLS below.

Aha!  Now we’re getting somewhere.  I give it an argument saying where I want to push to, that all makes perfect sense.  A quick skip down to the URLs bit tells me I can use ssh, which is what I want.

There’s one other mandatory argument though.

<refspec>…
The canonical format of a <refspec> parameter is +?<src>:<dst>;
that is, an optional plus +, followed by the source ref, followed
by a colon :, followed by the destination ref.

Err?

*blink*

Whuuuuh?

My brain seems to have fallen out of my head, let me pop it back in and read that paragraph again.

<refspec>…
The canonical format of a <refspec> parameter is +?<src>:<dst>;
that is, an optional plus +, followed by the source ref, followed
by a colon :, followed by the destination ref.

It didn’t get any better the second time.

Some faffing around, guess-work and cargo culting what other people do seems to suggest it wants the branch name there.  Well, why didn’t it say so?

Ok, that should be easy then.

quest util-linux% git push ssh://kernel.ubuntu.com/srv/kernel.ubuntu.com/git/scott/util-linux.git ubuntu
fatal: '/srv/kernel.ubuntu.com/git/scott/util-linux.git': unable to chdir or not a git archive
fatal: The remote end hung up unexpectedly

I’ve had a few ex-boyfriends hang up on me before, and they were gits too.

There’s nothing in the manual page about this.

There’s nothing in the tutorial.

What the holy crap is going on?

Turns out, you need to create the other side first.  Why the buggering bollocks can it not to that for you?

So, let’s try that.  There’s some clues about this in the git init manual page, but I have to be honest and I begged for help (and mercy) at this point:

quest util-linux% ssh zinc
zinc scott% cd /srv/kernel.ubuntu.com/git/scott
zinc scott% GIT_DIR=util-linux.git git init
Initialized empty Git repository in /srv/kernel.ubuntu.com/git/scott/util-linux.git/
zinc scott% exit
quest util-linux% git remote add zinc ssh://kernel.ubuntu.com/srv/kernel.ubuntu.com/git/scott
quest util-linux% git push zinc ubuntu
Counting objects: 10652, done.
Compressing objects: 100% (2545/2545), done.
Writing objects: 100% (10652/10652), 19.10 MiB | 12192 KiB/s, done.
Total 10652 (delta 8075), reused 10534 (delta 8013)
To ssh://kernel.ubuntu.com/srv/kernel.ubuntu.com/git/scott/util-linux.git
 * [new branch]      ubuntu -> ubuntu

Hurrah!  At last!

No.

Not at all.

Firstly, pushing to a remote branch doesn’t make it visible in anything like gitweb.  You have to do enable that.

quest util-linux% ssh zinc
zinc scott% cd /srv/kernel.ubuntu.com/git/scott/util-linux.git
zinc util-linux.git% chmod +x hooks/post-update
zinc util-linux.git% git update-server-info
zinc util-linux.git% exit

Ok, now does it work?

No.

Looks all ok, but if somebody tries and checks that out:

wing-commander scott% git clone git://kernel.ubuntu.com/git/scott/util-linux.git
Initialized empty Git repository in /home/scott/util-linux/.git/
warning: remote HEAD refers to nonexistent ref, unable to checkout.

What the hell?

How can a push command succeed while leaving an utterly useless branch?

Don’t bother trying to find this one in the manuals:

quest util-linux% ssh zinc
zinc scott% cd /srv/kernel.ubuntu.com/git/scott/util-linux.git
zinc util-linux.git% rm HEAD
zinc util-linux.git% ln -s refs/heads/ubuntu HEAD
zinc util-linux.git% exit

Now it works.

In all that is holy, what, the, fuck.

Seriously?

My quote of the day:

“Git is hard to use if you are not used to its workflow.”

No.

Git is hard to use.

Here’s what I wanted to do:

quest util-linux% revision-control-system push ssh://host/path/somewhere

If it takes anything more than that, it’s fucked.

51 Comments

  1. Jeff Dickey says:

    @lol (earlier comment):

    No, YOU suck.
    - Anonymous comment: -∞ for relevance
    - “xxx sucks” w/o details on why: -∞ for commenter maturity and intelligence
    - needlessly stomping on someone just because you disagree with them: -∞ for commenter maturity and intelligence

    So… can you do better? Build something better than git or svn or bzr or LSMFT, build a community and an ecosystem/infrastructure around your new creation and make the world see how much better it is?

    Didn’t think so.

    Eff off. And grow up. Not necessarily in that order.

Leave a Reply