2009-10-02 19:53:52 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2009-10-03 09:47:02 +02:00
|
|
|
# get this from your .gitolite.conf; and don't forget this is shell, while
|
|
|
|
# that is perl :-)
|
2009-11-19 13:08:40 +01:00
|
|
|
export GL_ADMINDIR; GL_ADMINDIR=$HOME/.gitolite
|
2009-10-02 19:53:52 +02:00
|
|
|
|
2009-10-03 09:47:02 +02:00
|
|
|
# checkout the master branch to $GL_ADMINDIR
|
|
|
|
GIT_WORK_TREE=$GL_ADMINDIR git checkout -f master
|
|
|
|
|
2009-10-04 12:21:32 +02:00
|
|
|
# remove all fragments. otherwise, you get spurious error messages when you
|
|
|
|
# take away someone's delegation in the main config but the fragment is still
|
|
|
|
# hanging around. The ones that are valid will get re-created anyway
|
|
|
|
rm -rf $GL_ADMINDIR/conf/fragments
|
2009-10-03 09:47:02 +02:00
|
|
|
# collect all the delegated fragments
|
2009-10-04 12:21:32 +02:00
|
|
|
mkdir $GL_ADMINDIR/conf/fragments
|
2009-11-19 13:08:40 +01:00
|
|
|
for br in `git for-each-ref --format='%(refname:short)'`
|
2009-10-03 09:47:02 +02:00
|
|
|
do
|
|
|
|
# skip master (duh!)
|
2009-10-05 12:38:10 +02:00
|
|
|
[ "$br" = "master" ] && continue
|
|
|
|
|
2009-10-03 09:47:02 +02:00
|
|
|
# all other branches *should* contain a file called <branchname>.conf
|
|
|
|
# inside conf/fragments; if so copy it
|
|
|
|
if git show $br:conf/fragments/$br.conf > /dev/null 2>&1
|
|
|
|
then
|
|
|
|
git show $br:conf/fragments/$br.conf > $GL_ADMINDIR/conf/fragments/$br.conf
|
|
|
|
echo "(extracted $br conf; `wc -l < $GL_ADMINDIR/conf/fragments/$br.conf` lines)"
|
|
|
|
else
|
|
|
|
echo " ***** ERROR *****"
|
|
|
|
echo " branch $br does not contain conf/fragments/$br.conf"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
|
|
|
|
cd $GL_ADMINDIR
|
2009-10-02 19:53:52 +02:00
|
|
|
src/gl-compile-conf
|