Merge tag 'v2.1.1' into debian-sid
[git/debian.git] / debian / examples / index.aux-generation
blob16390a395de13f51342c6c171f1acf09fb6eede0
1 From: Matthew Wilcox <matthew@wil.cx>
2 To: 383219@bugs.debian.org
3 Cc: Roland Mas <lolando@debian.org>
4 Subject: index.aux generation
5 Date: Thu, 24 Aug 2006 08:55:10 -0600
7 Alioth needs to generate an index.aux file.  It'd be helpful if we had
8 an example script for doing this.  Here's the script used for
9 git.infradead.org (MIT licence, says its author):
11 --- cut ---
12 #!/bin/sh
14 cd /home
15 for a in * ; do [ -r $a/public_git ] && [ ! -d /home/git/users/$a ] && ln -s /home/$a/public_git /home/git/users/$a ; done
17 cd /home/git
18 find . -name 'HEAD' | grep ^[-./=+a-zA-Z0-9]*\$ | sed s:/HEAD\$:: | while read DIR ; do
19         TREEUID=`stat -c %U $DIR`
20         TREEUSERNAME=`grep ^$TREEUID: /etc/passwd | cut -f5 -d: | sed s/\ /+/`
21         if [ "$TREEUSERNAME" = "" ]; then
22                 TREEUSERNAME=$TREEUID
23         fi
24         echo $DIR $TREEUSERNAME | sed s:/:%2F:g
25 done > /home/git/.index.aux.$$
27 mv /home/git/.index.aux.$$ /home/git/.index.aux
29 --- cut ---
31 I suspect Alioth wants something like (untested ...)
33 cd /srv/git.debian.org/git
34 ls */*/HEAD | grep ^[-./=+a-zA-Z0-9]*\$ | sed s:/HEAD\$:: | while read DIR ; do
35         TREEUID=`stat -c %U $DIR`
36         TREEUSERNAME=`XXX`
37         if [ "$TREEUSERNAME" = "" ]; then
38                 TREEUSERNAME=$TREEUID
39         fi
40         echo $DIR $TREEUSERNAME | sed s:/:%2F:g
41 done > /srv/git.debian.org/.index.aux.$$
43 mv /srv/git.debian.org/.index.aux.$$ /srv/git.debian.org/.index.aux
45 where XXX would be how to turn a username into the name of a user.
46 I dunno how Alioth works; ldap or postgres db seem plausible answers.