From 415e3fdd55b2ecdf2f35680694362a4b35fd1a05 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Sat, 5 Dec 2015 20:22:57 +0100 Subject: rewrite in C with libgit2, first version --- urmoms | 135 ----------------------------------------------------------------- 1 file changed, 135 deletions(-) delete mode 100755 urmoms (limited to 'urmoms') diff --git a/urmoms b/urmoms deleted file mode 100755 index 4243687..0000000 --- a/urmoms +++ /dev/null @@ -1,135 +0,0 @@ -#!/bin/sh - -# DEBUG -#set -e -x - -usage() { - printf '%s \n' "$0" - exit 1 -} - -header() { - cat < - - - - -${name} - ${description} - - - -
-

${name}

-${description}
-Log | -Files | -Stats | -README | -LICENSE -
-
-
-!__EOF__
-}
-
-footer() {
-	cat <
-
-
-!__EOF__
-}
-
-# usage: repodir and htmldir must be set.
-if test x"$1" = x"" || test x"$2" = x""; then
-	usage
-fi
-
-# make absolute path to htmldir.
-htmldir="$(readlink -f $2)"
-mkdir -p "${htmldir}"
-
-# repodir must be a directory to go to.
-cd "$1" || usage
-
-# default index page (symlink).
-indexpage="log.html"
-
-# project name, if bare repo remove .git suffix.
-name=$(basename "$(pwd)" ".git")
-
-# read .git/description.
-description=""
-test -f ".git/description" && description="$(cat '.git/description')"
-
-# make diff for each commit (all files).
-relpath="../"
-mkdir -p "${htmldir}/commit"
-git log --pretty='%H' | while read -r commit; do
-	test -e "${htmldir}/commit/${commit}.html" && continue
-
-	header > "${htmldir}/commit/${commit}.html"
-	git show --pretty=full "${commit}" | \
-		sed -E 's@^commit (.*)$@commit \1@g' >> "${htmldir}/commit/${commit}.html"
-	footer >> "${htmldir}/commit/${commit}.html"
-done 
-
-# make log with all commits.
-relpath=""
-header > "${htmldir}/log.html"
-printf '' >> "${htmldir}/log.html"
-git log --pretty='' >> "${htmldir}/log.html"
-printf '
%cr%H%an%s
' >> "${htmldir}/log.html" -footer >> "${htmldir}/log.html" - -# make index with file links. -relpath="" -header >> "${htmldir}/files.html" -printf '' >> "${htmldir}/files.html" -git ls-tree -r -l master | while read -r mode type object size file; do - git log -1 --pretty='' "${file}" -done >> "${htmldir}/files.html" -printf '
ModeNameSize
'${mode}''${file}''${size}'[plain]
' >> "${htmldir}/files.html" -footer >> "${htmldir}/files.html" - -# readme page -# find README file. -relpath="" -readme="" -for f in README README.md readme.md; do - test -e "${f}" && readme="${f}" -done -# make page. -header > "${htmldir}/readme.html" -if test x"${readme}" != x""; then - cat "${readme}" >> "${htmldir}/readme.html" -else - echo "no README file found" >> "${htmldir}/readme.html" -fi -footer >> "${htmldir}/readme.html" - -# license page -# find LICENSE file. -relpath="" -license="" -for f in LICENSE LICENSE.md; do - test -e "${f}" && license="${f}" -done -# make page. -header > "${htmldir}/license.html" -if test x"${readme}" != x""; then - cat "${license}" >> "${htmldir}/license.html" -else - echo "unknown license" >> "${htmldir}/license.html" -fi -footer >> "${htmldir}/license.html" - -# stats (authors). -relpath="" -header > "${htmldir}/stats.html" -git shortlog -n -s >> "${htmldir}/stats.html" -footer >> "${htmldir}/stats.html" - -# symlink to index page. -ln -sf "$indexpage" "${htmldir}/index.html" -- cgit v1.2.3