blob: 0d6e799a1a7f187e26f48c6df9bde70fb743f464 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
#!/bin/sh
# Generate a .mrconfig containing all private repos
# adopted from https://github.com/svend/home-bin/blob/master/gen-mrconfig-priv
# Exapmple:
# ./gen-mrconfig.sh gitolite@admin.leap.se
SSH=$1
gen_mrconfig ()
{
while read s; do
echo "[$(basename $s)]"
echo "checkout = git clone ssh://$SSH/$s"
echo
done
}
#ssh $SSH expand |
ssh $SSH |
# gitolite outputs list with DOS line endings
tr -d '\r' |
# only pick lines with space at the beginning
grep '^ ' |
# Last field contains the repo name
awk '{print $NF}' |
# filter out all special gitolite groups, i.e. @all
grep -v '^@' |
# All private repos are under svend-priv/
#grep -e '^svend-priv/' -e '^gitolite-admin$' |
gen_mrconfig |
# Delete last empty line
sed '$d'
|