Skip to content. | Skip to navigation

Sections
Personal tools
What is this?
Hi, my name is Tom Lazar and I'm a Plone and Zope developer based in Berlin, Germany and this is my personal and professional (no big difference, really...) website.
 

gitosis and virtualenv

Filed Under:

Notes on setting up gitosis (on FreeBSD) using virtualenv.

Basically, the following is a condensed and simpler version of the excellent tutorial over at scie.nti.st, except that we don't use the system-wide site-packages. The crucial simplifications are:

  • we don't muck about with $PYTHONPATH or /etc/environment because that's evil :)
  • instead we use virtualenv

First, install git:

cd /usr/ports/devel/git
sudo make install

Install python and friends:

cd /usr/ports/lang/python25
sudo make install
...
cd /usr/ports/devel/py-setuptools
sudo make install
...
sudo easy_install virtualenv

Add a git user:

sudo pw adduser -n git -m

Copy the public key:

cp ~/.ssh/authorized_keys /tmp/gitosis.pub

Become the git user and install gitosis using virtualenv:

sudo su - git
virtualenv . --no-site-packages
mkdir src
cd src/
git clone git://eagain.net/gitosis.git
cd gitosis
../../bin/python setup.py install

The only thing missing now is to use absolut paths in the hook script (to make it work with virtualenv). IOW, /home/git/repositories/gitosis-admin.git/hooks/post-update should look like this:

#!/bin/sh
set -e
/home/git/bin/gitosis-run-hook post-update
/usr/local/libexec/git-core/git-update-server-info

Make sure, the hook's executable bit is set:

chmod a+x /home/git/repositories/gitosis-admin.git/hooks/post-update

Voila! You can clone the gitosis-admin repository and start working with it.