#!/bin/sh # This script is used to setup a git repository. set -e USAGE="\n\ This script is used to perform the operations needed to create a git\n\ repository.\n\ \n\ Usage: setup-repository ''\n\ \n\ Options: is the package name a git repository is being created for.\n\ is a description for the git repository.\n\ It should be something like 'Packaging for '.\n" if [ "$#" -ne "2" ]; then echo -e "${USAGE}" exit 1 fi PACKAGE="$1" DESCRIPTION="$2" # Create the repository mkdir $PACKAGE.git cd $PACKAGE.git /usr/bin/git --bare init --shared # Add the repository description echo "$DESCRIPTION" >description # Enable the hook scripts [ -f hooks/post-update ] || cp hooks/post-update.sample hooks/post-update chmod a+x hooks/post-update git config --add hooks.mailinglist "utnubu-commits@lists.alioth.debian.org" git config --add hooks.subjectdesc $PACKAGE cat >hooks/post-receive <