Introduction
Introduction Statistics Contact Development Disclaimer Help
texample.sh: add index-time.html, list sorted by time, fix reposdir '/' - stagi…
git clone git://src.adamsgaard.dk/stagit
Log
Files
Refs
README
LICENSE
---
commit fd66a29d3ab2f226bc457cb4b3db63da8dff6bf0
parent 9a781328821c1e37987be5573114a6ff3b6e0ee6
Author: Hiltjo Posthuma <[email protected]>
Date: Fri, 8 Jan 2016 13:39:23 +0100
example.sh: add index-time.html, list sorted by time, fix reposdir '/'
Diffstat:
M example.sh | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/example.sh b/example.sh
t@@ -14,16 +14,28 @@
set -e
-reposdir="/var/www/domains/git.codemadness.nl/home/src/"
+reposdir="/var/www/domains/git.codemadness.nl/home/src"
curdir=$(pwd)
# make index.
cd "${reposdir}"
-find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index > "${cu…
+find . -maxdepth 1 -type d | grep -v "^.$" | sort | xargs stagit-index |
+ sed 's@<td>Last commit</td>@<td><a href="index-time.html">Last commit<…
+ sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${cu…
+
+# make index (sort by last commit author time).
+find . -maxdepth 1 -type d | grep -v "^.$" | while read -r dir; do
+ d=$(basename "${dir}")
+ cd "${reposdir}/${d}"
+ timestamp=$(git show -s --pretty="format:%at" || true)
+
+ printf "%d %s\n" "${timestamp}" "${d}"
+done | sort -n -k 1 | cut -f 2- -d ' ' | xargs stagit-index | \
+ sed 's@<td>Last commit</td>@<td><a href="index-time.html">Last commit<…
+ sed 's@<td>Name</td>@<td><a href="index.html">Name</a></td>@g' > "${cu…
# make files per repo.
find . -maxdepth 1 -type d | grep -v "^.$" | sort | while read -r dir; do
- cd "${reposdir}"
d=$(basename "${dir}")
printf "%s..." "${d}"
t@@ -31,7 +43,7 @@ find . -maxdepth 1 -type d | grep -v "^.$" | sort | while re…
test -d "${d}" || mkdir -p "${d}"
cd "${d}"
- stagit "${reposdir}${d}"
+ stagit "${reposdir}/${d}"
printf " done\n"
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.