#!/bin/sh
#
# Upload git configuration from here to the repo
# Please do not introduce bashisms into this script.
#
# Note: This script does not curently work. It used to, on Berlios.
# We leave it here because light modifications will probably work
# on may forges.

# Get around the usual ssh lockout on a repo host by copying up to 
# the shell host and doing a local move. Written so the last
# move is atomic.
copy()
{
    scp $1 $LOGNAME@shell.xyzzy.foo:STAGE
    ssh $LOGNAME@git.xyzzy.foo "cp -f STAGE /gitroot/gpsd && mv /gitroot/gpsd/STAGE /gitroot/gpsd/$1"
}

if [ $1 ]
then
    for f in $*; do copy $f ; done
else
    copy config
    for file in hooks/*
    do
        copy $file
    done
fi

# End

