aboutsummaryrefslogtreecommitdiff
path: root/scripts/git-static-index.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/git-static-index.sh')
-rwxr-xr-xscripts/git-static-index.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/scripts/git-static-index.sh b/scripts/git-static-index.sh
new file mode 100755
index 00000000..fb9ac4e5
--- /dev/null
+++ b/scripts/git-static-index.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+# Create very basic index.html and commit links for a static git archive
+
+mkdir -p commit
+git log --pretty=%H | while read i
+do
+ [ -e commit/$i ] && break
+ git format-patch -1 --stdout $i > commit/$i
+ ln -sf $i commit/${i::12}
+done
+
+echo '<html><body><font face=monospace><table border=1 cellpadding=2>'
+echo '<tr valign=top><td>commit</td><td>author</td><td>date</td><td>description</td></tr>'
+git log --pretty='%H%n%an<%ae>%n%ad%n%s' --date=format:'%r<br />%d-%m-%Y' | while read HASH
+do
+ HASH="${HASH::12}"
+ read AUTHOR
+ AUTHOR1="${AUTHOR/<*/}"
+ AUTHOR1="${AUTHOR1::17}"
+ AUTHOR2="&lt;${AUTHOR/*</}"
+ AUTHOR2="${AUTHOR2::20}"
+ read DATE
+ DATE="${DATE/ /&nbsp;}"
+ read DESC
+ echo "<tr valign=top><td><a href=commit/$HASH>$HASH</a></td><td>$AUTHOR1<br />$AUTHOR2</td><td>$DATE</td><td>$DESC</td></tr>"
+done
+echo "</table></body></html>"