#!/bin/sh

cat <<HEAD
<html>
<head>
<title>Trinity Desktop Environment - Patches from GIT</title>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
</head>
<body link=blue vlink=blue alink=blue bgcolor=white text=black>
<table width=100%>
<tr><td><b>GIT Hash</b></td><td><b>Date</b></td><td><b>Author</b></td><td><b>Log Message</b></td></tr>
HEAD

git submodule --quiet foreach "git log --abbrev=8 --no-merges --pretty=format:\"%at:<tr valign=\\\"top\\\"><td><a href=\\\"http://git.trinitydesktop.org/cgit/\$(basename \$PWD)/patch/?id=%h\\\">%h</a></td><td style=\\\"white-space: nowrap\\\">%ai</td><td style=\\\"white-space: nowrap\\\">%an</td><td>[\$(basename \$PWD)] %B%x01\"" | \
tr "\n" "\0" | tr "\1" "\n" | \
grep -av "Reset submodule .* to latest HEAD" | \
sed -e "s|^\x00||" -e "s|git-svn-id:[^\x00]*\x00||" -e "s|\x00\+$|</td></tr>|" -e "s|\x00\+|<br/>|g" | \
sort -rn | sed "s|^[^:]*:||"

cat <<BOTTOM
</table>
<p>List generated $(LANG=C date)</p>
</body>
</html>
BOTTOM
