summaryrefslogtreecommitdiffhomepage
path: root/git/archive
diff options
context:
space:
mode:
Diffstat (limited to 'git/archive')
-rwxr-xr-xgit/archive/stagit.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/git/archive/stagit.sh b/git/archive/stagit.sh
new file mode 100755
index 0000000..f2f4227
--- /dev/null
+++ b/git/archive/stagit.sh
@@ -0,0 +1,53 @@
1#!/bin/bash
2# - Makes index for repositories in a single directory.
3# - Makes static pages for each repository directory.
4#
5# NOTE, things to do manually (once) before running this script:
6# - copy style.css, logo.png and favicon.png manually, a style.css example
7# is included.
8#
9# - write clone URL, for example "git://git.codemadness.org/dir" to the "url"
10# file for each repo.
11# - write owner of repo to the "owner" file.
12# - write description in "description" file.
13#
14# Usage:
15# - mkdir -p htmldir && cd htmldir
16# - sh example_create.sh
17
18ORIG_DIR=`pwd`
19
20# path must be absolute.
21reposdir="/srv/git"
22curdir="/srv/git/www"
23
24cd ${curdir}
25
26# make files per repo.
27for dir in "${reposdir}/"*/; do
28 # strip .git suffix.
29 r=$(basename "${dir}")
30 d=$(basename "${dir}" ".git")
31 printf "%s... " "${d}"
32
33 mkdir -p "${curdir}/${d}"
34 cd "${curdir}/${d}" || continue
35
36 test -f ${dir}/owner || echo `whoami` >${dir}/owner
37 test -f ${dir}/url || echo git://git.topo.tw/${d} >${dir}/url
38
39 stagit -c ".cache" -u "https://git.codemadness.nl/$d/" "${reposdir}/${r}"
40
41 # symlinks
42 ln -sf log.html index.html
43 ln -sf ../style.css style.css
44 ln -sf ../logo.png logo.png
45 ln -sf ../favicon.png favicon.png
46
47 echo "done"
48done
49
50# make index.
51stagit-index "${reposdir}/"*/ > "${curdir}/index.html"
52
53cd ${ORIG_DIR}