X-Git-Url: https://git.plutz.net/?a=blobdiff_plain;ds=sidebyside;f=macros%2Frevisions;h=4271149cffbd8074d89f16d88418b26f5f842441;hb=3582e177e2769524b539c08ac1f76024f26a929e;hp=c6fb8fa2cb59b7d239b81f372515a5ed96ed3a55;hpb=a6ae272ce0af6b93cabddf4aa4a3cebc7350f5a0;p=shellwiki
diff --git a/macros/revisions b/macros/revisions
index c6fb8fa..4271149 100755
--- a/macros/revisions
+++ b/macros/revisions
@@ -9,18 +9,19 @@ page_abs="$(page_abs "$page")"
if ! acl_read "$page_abs"; then
return 0
-elif [ ! "$(which git)" ]; then
+elif [ "$REV_PAGES" != true ]; then
printf '
GIT is not available to handle revisioning.
'
fi
-printf ''
+printf '\n'
IFS=" "
- git -C "$_DATA" log --date=format:"%a, %x %H:%M" \
- --pretty=format:"%h %cd %s%n" \
- -- "pages${page_abs}#page.md" \
- | while read hash date message; do
+ { git -C "$_DATA" log --date=format:"%a, %x %H:%M" \
+ --pretty=format:"%h %cd %s" \
+ -- "pages${page_abs}#page.md"
+ printf '\n'
+ } | while read -r hash date message; do
user="${message% @*}"; user="${user##*@ }"
- printf '%s%s%s' \
- "$(HTML "${page%/}/[revisions]/$hash")" "$(HTML "$hash")" "$(HTML "$date")" "$(HTML "$user")"
+ printf '- %s%s%s
\n' \
+ "$(HTML "${page%/}/[revision]/$hash")" "$(HTML "$hash")" "$(HTML "$date")" "$(HTML "$user")"
done
-printf '
'
+printf '
\n'