michaeldejong/Java-Gitolite-Manager — pull request #12 by michaeldejong (2013-09-11 09:57:18+00:00)
Title: Added very basic support for automatic removal of removed repositories

It's now possible to remove repositories automatically from disk without having to deploy Java-Gitolite-Manager on the gitolite server, nor use an SSH connection. In stead I've created a small Java program `nl.minicom.gitolite.purger.Purger` which can be called using a git hook on the `gitolite-admin` repo. A bash or perl version of this program would be nicer, but this will work for now.

#### How to install.

1. Create a runnable JAR, with the `Purger` class set as the runnable class.
2. Copy this JAR file to `/home/git` on the gitolite server.
3. Create a new git hook at `/home/git/.gitolite/hooks/gitolite-admin/post-receive` with the following contents:

```perl
#!/usr/bin/perl -w

use strict;
use warnings;

print `java -jar /home/git/purger.jar /home/git/repositories`;

exit 0;
```

4. Run `/home/git/bin/gitolite setup --hooks-only` to install the new hook.
5. Now the `/home/git/repositories` directory should be automatically cleaned after every push to the `gitolite-admin` repo.

#### Not done yet
This should be further improved before this is merged, but the concept works quite well.