initial insertion
5 files changed, 156 insertions(+), 0 deletions(-) | |||
---|---|---|---|
A | README | +1 | -0 |
A | TODO | +15 | -0 |
A | logo.png | +0 | -0 |
A | style.css | +23 | -0 |
A | urmoms | +117 | -0 |
1@@ -0,0 +1 @@
2+to use urmom is quite easy...
A · TODO
+15, -0 1@@ -0,0 +1,15 @@
2+- be smarter about changes (an existing commit can never change the diff page).
3+- add raw link to latest files: raw/file...
4+- add summary page?
5+- add diffstat to diff page? + and - lines summary?
6+- escape < > ' " etc, maybe even use CDATA ?
7+- shorter date format for logs.html page.
8+- speed up generating files.
9+- add stylesheet + 2f30/suckless logo.
10+- for files link to the commit but make the filename a link anchor.
11+- default to log view (stateless).
12+- link to lines in file view! / commit log?
13+- show all the tags and branches as list.
14+- show commits for all tags and branches???
15+- no tarballs, snapshots and such.
16+- able to add link to git url: git://url... per project.
A · logo.png
+0, -0
A · style.css
+23, -0 1@@ -0,0 +1,23 @@
2+body {
3+ font-family: sans-serif;
4+ color: #00ff00;
5+ background-color: #000;
6+}
7+
8+h1 {
9+ vertical-align: middle;
10+}
11+
12+a {
13+ color: #00ff00;
14+}
15+
16+hr {
17+ color: #00ff00;
18+ background-color: #00ff00;
19+ border-top: 1px solid #00ff00;
20+}
21+
22+pre {
23+ font-family: monospace;
24+}
A · urmoms
+117, -0 1@@ -0,0 +1,117 @@
2+#!/bin/sh
3+
4+# DEBUG
5+#set -e -x
6+
7+baseurl="http://cow.codemadness.org/gitlog/"
8+# TODO: read .git/description.
9+description="sbase"
10+logdir="../gitlog"
11+
12+header() {
13+ cat <<!__EOF__
14+<!DOCTYPE HTML>
15+<html dir="ltr" lang="en">
16+<head>
17+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
18+<meta http-equiv="Content-Language" content="en" />
19+<title>${description}</title>
20+<base href="${baseurl}" />
21+<link rel="stylesheet" type="text/css" href="style.css" />
22+</head>
23+<body>
24+<center>
25+<h1><img src="logo.png" alt="" /> ${description}</h1>
26+<a href="index.html">Tree</a> |
27+<a href="log.html">Log</a> |
28+<a href="stats.html">Stats</a> |
29+<a href="readme.html">README</a> |
30+<a href="license.html">LICENSE</a>
31+</center>
32+<hr/>
33+<pre>
34+!__EOF__
35+}
36+
37+footer() {
38+ cat <<!__EOF__
39+</pre>
40+<hr/>
41+<i><center>Powered by urmoms vibrator</center></i>
42+</body>
43+</html>
44+!__EOF__
45+}
46+
47+mkdir -p "${logdir}"
48+firstcommit=$(git log | grep '^commit ' | tail -n 1 | cut -f 2 -d ' ')
49+
50+# make log per file.
51+# TODO: just link to commit/commit? save some space and time?
52+git ls-tree -r --name-only master | while read -r file; do
53+ test -e "${logdir}/file/${file}.html" && continue
54+
55+ d=$(dirname "${file}")
56+ mkdir -p "${logdir}/file/${d}"
57+
58+ header > "${logdir}/file/${file}.html"
59+ git show "${firstcommit}"...master "${file}" | \
60+ sed -E 's@^commit (.*)$@commit <a href="commit/\1.html">\1</a>@g' >> "${logdir}/file/${file}.html"
61+ footer >> "${logdir}/file/${file}.html"
62+done
63+
64+# make log with all commits.
65+header > "${logdir}/log.html"
66+printf '<table border="0">' >> "${logdir}/log.html"
67+git log --pretty='<tr><td align="right">%cD</td><td><a href="commit/%H.html">%H</a></td><td>%an</td><td>%s</td></tr>' >> "${logdir}/log.html"
68+printf '</table>' >> "${logdir}/log.html"
69+footer >> "${logdir}/log.html"
70+
71+# make diff for each commit (all files).
72+mkdir -p "${logdir}/commit"
73+git log --pretty='%H' | while read -r commit; do
74+ test -e "${logdir}/commit/${commit}.html" && continue
75+ header > "${logdir}/commit/${commit}.html"
76+ git show "${commit}" >> "${logdir}/commit/${commit}.html"
77+ footer >> "${logdir}/commit/${commit}.html"
78+done
79+
80+# make index with file links.
81+header >> "${logdir}/index.html"
82+git ls-tree -r master | sed -E 's@ (.*)$@ <a href="file/\1.html">\1</a>@g' >> "${logdir}/index.html"
83+footer >> "${logdir}/index.html"
84+
85+# readme page
86+# find README file.
87+readme=""
88+for f in README README.md readme.md; do
89+ test -e "${f}" && readme="${f}"
90+done
91+# make page.
92+header > "${logdir}/readme.html"
93+if test x"${readme}" != x""; then
94+ cat "${readme}" >> "${logdir}/readme.html"
95+else
96+ echo "no README file found" >> "${logdir}/readme.html"
97+fi
98+footer >> "${logdir}/readme.html"
99+
100+# license page
101+# find LICENSE file.
102+license=""
103+for f in LICENSE LICENSE.md; do
104+ test -e "${f}" && license="${f}"
105+done
106+# make page.
107+header > "${logdir}/license.html"
108+if test x"${readme}" != x""; then
109+ cat "${license}" >> "${logdir}/license.html"
110+else
111+ echo "unknown license" >> "${logdir}/license.html"
112+fi
113+footer >> "${logdir}/license.html"
114+
115+# stats (authors).
116+header > "${logdir}/stats.html"
117+git shortlog -n -s >> "${logdir}/stats.html"
118+footer >> "${logdir}/stats.html"