3 # Generates revision-info.php file which is used by demo server
8 remote_url
=`git remote show -n origin | grep 'Fetch' | sed 's/.*URL: //'`
9 ref
=$
(git symbolic-ref
-q HEAD || git name-rev
--name-only HEAD
2>/dev
/null
)
10 ref
=${ref#refs/heads/}
11 rev=`git describe --always`
12 fullrev
=`git log -1 | head -n 1 | awk '{print $2}'`
13 if [ "$remote_url" = "git://github.com/phpmyadmin/phpmyadmin.git" ] \
14 ||
[ "$remote_url" = "https://github.com/phpmyadmin/phpmyadmin" ]; then
15 repobase
="https://github.com/phpmyadmin/phpmyadmin/commit/"
16 repobranchbase
="https://github.com/phpmyadmin/phpmyadmin/tree/"
18 elif echo "$remote_url" |
grep -q "git://github.com/" ; then
19 repobase
=`echo $remote_url | sed 's@git://github.com/\(.*\)/\(.*\).git@https://github.com/\1/\2/commit/@'`
20 repobranchbase
=`echo $remote_url | sed 's@git://github.com/\(.*\)/\(.*\).git@https://github.com/\1/\2/tree/@'`
21 reponame
=`echo $remote_url | sed 's@git://github.com/\(.*\)/\(.*\).git@\1@'`
23 repobase
=`echo $remote_url | sed 's@git://repo.or.cz@http://repo.or.cz/w@'`/commitdiff
/
24 repobranchbase
=`echo $remote_url | sed 's@git://repo.or.cz@http://repo.or.cz/w@'`/shortlog
/refs
/heads
/
27 cat > revision-info.php.tmp
<<EOT
30 \$fullrevision = '$fullrev';
31 \$repobase = '$repobase';
32 \$reponame = '$reponame';
33 \$repobranchbase = '$repobranchbase';
37 mv revision-info.php.tmp revision-info.php