From acd240004960dbbce6081b338ee4ed1775acfd1e Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Fri, 4 Dec 2015 16:58:04 +0100 Subject: [PATCH] initial insertion --- README | 1 + TODO | 15 +++++++ logo.png | Bin 0 -> 505 bytes style.css | 23 +++++++++++ urmoms | 117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 README create mode 100644 TODO create mode 100644 logo.png create mode 100644 style.css create mode 100644 urmoms diff --git a/README b/README new file mode 100644 index 0000000..87656d6 --- /dev/null +++ b/README @@ -0,0 +1 @@ +to use urmom is quite easy... diff --git a/TODO b/TODO new file mode 100644 index 0000000..a0fc005 --- /dev/null +++ b/TODO @@ -0,0 +1,15 @@ +- be smarter about changes (an existing commit can never change the diff page). +- add raw link to latest files: raw/file... +- add summary page? +- add diffstat to diff page? + and - lines summary? +- escape < > ' " etc, maybe even use CDATA ? +- shorter date format for logs.html page. +- speed up generating files. +- add stylesheet + 2f30/suckless logo. +- for files link to the commit but make the filename a link anchor. +- default to log view (stateless). +- link to lines in file view! / commit log? +- show all the tags and branches as list. +- show commits for all tags and branches??? +- no tarballs, snapshots and such. +- able to add link to git url: git://url... per project. diff --git a/logo.png b/logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a7bc30200b520d21401b9d543eb73f013342cee6 GIT binary patch literal 505 zcmeAS@N?(olHy`uVBq!ia0vp^2_VeD1|%QND7OGoEX7WqAsj$Z!;#Vf4nJ zXtsecqtcuEJwQRp64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq!<_&%RF5i zLn`LHy&ITy$U(&6;*t{Pbw_nyM8!E53Apn9N|vn8b91rQ_^nlgPI`C029G?&dRrMK}e76~0C8KTyB5 zeCy_;EI>6N5jBUL8(J?4EPAT0L>n?fHFFA7@7lZI_19fhe~Wg$*;T)O?eqJyIic!( z8g5)(+vK+M`>IS4VXz544Ko-v=7?@7KmR;*CXfv`1!O!(5-3o9pL^5u&(=s9rrU~t z$$4JCZ3aRI@9(Qe%6~8W^RYtalMF&BHuFG!KYuf=7gs%~d`kKjFq#-VUHx3vIVCg!06n(4S^xk5 literal 0 HcmV?d00001 diff --git a/style.css b/style.css new file mode 100644 index 0000000..0fa610c --- /dev/null +++ b/style.css @@ -0,0 +1,23 @@ +body { + font-family: sans-serif; + color: #00ff00; + background-color: #000; +} + +h1 { + vertical-align: middle; +} + +a { + color: #00ff00; +} + +hr { + color: #00ff00; + background-color: #00ff00; + border-top: 1px solid #00ff00; +} + +pre { + font-family: monospace; +} diff --git a/urmoms b/urmoms new file mode 100644 index 0000000..3e30cda --- /dev/null +++ b/urmoms @@ -0,0 +1,117 @@ +#!/bin/sh + +# DEBUG +#set -e -x + +baseurl="http://cow.codemadness.org/gitlog/" +# TODO: read .git/description. +description="sbase" +logdir="../gitlog" + +header() { + cat < + + + + +${description} + + + + +
+

${description}

+Tree | +Log | +Stats | +README | +LICENSE +
+
+
+!__EOF__
+}
+
+footer() {
+	cat <
+
+
Powered by urmoms vibrator
+ + +!__EOF__ +} + +mkdir -p "${logdir}" +firstcommit=$(git log | grep '^commit ' | tail -n 1 | cut -f 2 -d ' ') + +# make log per file. +# TODO: just link to commit/commit? save some space and time? +git ls-tree -r --name-only master | while read -r file; do + test -e "${logdir}/file/${file}.html" && continue + + d=$(dirname "${file}") + mkdir -p "${logdir}/file/${d}" + + header > "${logdir}/file/${file}.html" + git show "${firstcommit}"...master "${file}" | \ + sed -E 's@^commit (.*)$@commit \1@g' >> "${logdir}/file/${file}.html" + footer >> "${logdir}/file/${file}.html" +done + +# make log with all commits. +header > "${logdir}/log.html" +printf '' >> "${logdir}/log.html" +git log --pretty='' >> "${logdir}/log.html" +printf '
%cD%H%an%s
' >> "${logdir}/log.html" +footer >> "${logdir}/log.html" + +# make diff for each commit (all files). +mkdir -p "${logdir}/commit" +git log --pretty='%H' | while read -r commit; do + test -e "${logdir}/commit/${commit}.html" && continue + header > "${logdir}/commit/${commit}.html" + git show "${commit}" >> "${logdir}/commit/${commit}.html" + footer >> "${logdir}/commit/${commit}.html" +done + +# make index with file links. +header >> "${logdir}/index.html" +git ls-tree -r master | sed -E 's@ (.*)$@ \1@g' >> "${logdir}/index.html" +footer >> "${logdir}/index.html" + +# readme page +# find README file. +readme="" +for f in README README.md readme.md; do + test -e "${f}" && readme="${f}" +done +# make page. +header > "${logdir}/readme.html" +if test x"${readme}" != x""; then + cat "${readme}" >> "${logdir}/readme.html" +else + echo "no README file found" >> "${logdir}/readme.html" +fi +footer >> "${logdir}/readme.html" + +# license page +# find LICENSE file. +license="" +for f in LICENSE LICENSE.md; do + test -e "${f}" && license="${f}" +done +# make page. +header > "${logdir}/license.html" +if test x"${readme}" != x""; then + cat "${license}" >> "${logdir}/license.html" +else + echo "unknown license" >> "${logdir}/license.html" +fi +footer >> "${logdir}/license.html" + +# stats (authors). +header > "${logdir}/stats.html" +git shortlog -n -s >> "${logdir}/stats.html" +footer >> "${logdir}/stats.html"