views:

1571

answers:

7

I am trying to install Git on Mac OS X Leopard. I'm trying to avoid the MacPorts/Fink route. I'm also trying to avoid the installer on Google because I've gotten very far on my own, but if I have to I'll go ahead and download the installer.

Anyway, I have Git installed. /usr/local/bin/git. The problem is that none of the documentation installed, and the Makefile never bothered to tell me that. So now I have Git sitting around waiting to be used as I try to install the manpages for it.

For some awful reason, the manpages are maintained as text files, which are to be processed by the AsciiDoc program, which I promptly installed. But AsciiDoc converts these text files to XML.

Then Git uses another program called xmlto to convert the XML that AsciiDoc spits out to manpages (I think - I haven't gotten that far yet). The problem is that I get this error whenever it starts that step (first line is output from make, rest is error):

    XMLTO git-apply.1
I/O error : Attempt to load network entity http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd
/Users/chrislutz/prog/sources/git-1.6.3.1/Documentation/git-apply.xml:2: warning: failed to load external entity "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"
D DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd"

So basically it just goes through every file and gives me that error for all of them.

I did try at one point to download the file http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd, put it in the directory, and then changed all the references in the XML files to the file in the directory, but this gave me more and stranger errors. If I got a regular solution to work, it might still give me those stranger errors, which means the whole thing is screwed and that I'll just use the Google installer.

However, I've gotten (stumbled) this far on my own, and I feel like this is one last step before a sigh of relief and the chance to use Git. So I want to make a last-ditch effort to understand what's wrong. And "last-ditch effort" means "Ask Stack Overflow."

So if anyone could give me any insight as to what that error means and why it's occuring (and what I might be able to do to fix it), that would be awesome. If not, I'll try the Google installer.

+3  A: 

Maybe not the answer you want, but you could just download the git-manpages-*.tar.gz and git-html-*.tar.gz that are published along with the source. They're published because the asciidoc toolchain is known to be a bit fragile, and a considerable effort to get everything installed and arranged.

You'd need, I believe, possibly a whole pack of docbook support files. Maybe some stylesheets as well... although if you have xmlto installed you should have got all these.

araqnid
At this point, the answer I want is the answer that works best. I didn't want to have to reinstall Git just to get the manpages, and this worked perfectly. I wish I had checked their index sooner. In short, thank you!
Chris Lutz
+2  A: 

Wincent Colaiuta maintains a very useful knowledge base at wincent.com/wiki which is an excellent source of information on git on Mac OS X.

In particular, see these two articles:

Matt G
It's kind of depressing to know how close I was. I got all the way to the last step on my own and then gave up.
Chris Lutz
+4  A: 

I recently installed git-1.6.4.2 on CentOS 5.3. Building git was no trouble, but attempting to install the accompanying docs produced pain at every step. The versions of xmlto and asciidoc from the yum repos were old, so I built them from source. Then xmlto (by way of xmllint) complained about missing DocBook 4.5, and I finally managed to get those in manually.

Getting this far, the doc build trundles happily along until

    DB2TEXI user-manual.texi
/bin/sh: line 1: docbook2x-texi: command not found
make[1]: *** [user-manual.texi] Error 127

But docbook2x is installed! Ah, the command is different:

$ rpm -q --filesbypkg docbook2x | grep bin.\*texi
docbook2x                 /usr/bin/db2x_docbook2texi
docbook2x                 /usr/bin/db2x_texixml

Even trying to run it manually, I still find no joy:

$ db2x_docbook2texi user-manual.xml --encoding=UTF-8 --to-stdout >user-manual.texi++
docbook2texi:/book: no description for directory entry
/usr/bin/db2x_texixml:-::node: fatal error: node belongs to a different file
Died at /usr/bin/db2x_texixml line 959.

The bottom of INSTALL mentions a couple of handy make targets: quick-install-man and quick-install-html. It turns, for example, out that

$ make prefix=/usr/local quick-install-man

is equivalent to

$ ./Documentation/install-doc-quick.sh origin/man /usr/local/share/man

That has a couple of problems: we need a git repo to use these targets, and the heads of the man and html branches may not correspond to the version you're installing.

So, a quick-and-dirty bootstrap:

tar xfz git-1.6.4.2.tar.gz
cd git-1.6.4.2
make prefix=/usr/local all
sudo make prefix=/usr/local install  # (1)

cd ..
git clone git://git.kernel.org/pub/scm/git/git.git
cd git
git checkout v1.6.4.2  # (2)

# (3)
./Documentation/install-doc-quick.sh \
  c8b9e605d51dd2f0c7ce6a363df31171af16534c \
  /usr/local/share/man

# (4)
./Documentation/install-doc-quick.sh \
  35b47ca5285a4059792ba937f8e09b2ab4a7adf4 \
  /usr/local/share/doc/git-doc

git init --help  # (5)

Notes:

  1. At this point, git will live in /usr/local/bin.
  2. Now you'll have the same tree as the previous step on a detached head.
  3. The SHA-1 comes from the last 1.6.4.2 commit in git log origin/man.
  4. Same as above, except from origin/html.
  5. Profit!
Greg Bacon
A: 

Random thought; where are your Git manpages installed? I’m guessing in /usr/local/git/man. If so, check that this is in your $MANPATH:

echo $MANPATH

If you don’t have the git manpath in there, add this text via TextMate or vi or something to wherever you’ve got your $PATH (eg in ~/.bash_profile);

export MANPATH=/usr/local/git/man:$MANPATH

Alternatively just use this command from the shell:

echo 'export MANPATH=/usr/local/git/man:$MANPATH' >> ~/.bash_profile

Just had this problem myself after doing the Hivelogic Snow Leopard install, so HTH

Boblet
+1  A: 

I just found this nice solution to the Git manpages chain problem on OS X. For convenience, here it is (replace: git-manpages-1.6.6.tar.bz2 with your version of git, and /usr/local/ to wherever your git is installed):

$ curl -O http://kernel.org/pub/software/scm/git/git-manpages-1.6.6.tar.bz2
$ sudo tar xvf git-manpages-1.6.6.tar.bz2 -C /usr/local/man

Then, (as Boblet points out), check for the git manpath:

echo $MANPATH

and adjust if necessary:

Dave Everitt
Thank you — clear, intelligible, works.
jongala
A: 

If you're working from a clone of the git source repository, you can do something like this:

git archive origin/man | sudo tar -x -C /usr/local/share/man

Found at http://johnreilly.tumblr.com/post/41241198/installing-git-man-pages - I've been using it for some time now, and it Just Works very well.

JdV
A: 

I was having a similar build issue on Cygwin earlier this week (failure on attempt to load network entity), and through a bit of hunting I was able to find that the problem was the lack of an xml-catalog. On Cygwin there's a script named build-docbook-catalog. The tool was probably trying to run automatically, but when I ran it manually, it was failing due to the /etc/xml directory not existing.

The source for build-docbook-catalog is probably here, but I can't confirm that right now since I don't have Windows or Cygwin available.

I realize that this question has been long since answered, but I did stumble upon this page while looking for an answer to my problem, so hopefully this saves some time for someone else.

Mark Rushakoff