From 3b8b3545b0154b0d5c638215dc98f9dcc3b1e751 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sat, 24 Jan 2009 05:50:11 +0100 Subject: [PATCH] Add a link to older entries Signed-off-by: Johannes Schindelin --- upload.sh | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/upload.sh b/upload.sh index f5d1d922d4..4cde874a71 100755 --- a/upload.sh +++ b/upload.sh @@ -170,6 +170,20 @@ get_blog_entries () { done } +get_last_removed_entry () { + git log --pretty=format: --name-only --diff-filter=D HEAD | + while read line + do + case "$line" in + source-*.txt) file=$line;; + '') test -z "$file" || { + echo "$file" + break + };; + esac + done +} + # make HTML page make_html () { body_style="width:800px" @@ -203,14 +217,23 @@ EOF echo "" echo "" echo "
Table of contents:
" - echo '

    ' + echo '

      ' get_blog_entries | while read timestamp filename title do date="$(date +"%d %b %Y" -d @$timestamp)" echo "
    • $date $title" done - echo '

' + echo '

' + file= + last_removed_entry=$(get_last_removed_entry) + test -z "$last_removed_entry" || { + commit=$(git log --pretty=format:%H --diff-filter=AM \ + -- $last_removed_entry | + head -n 1) + previous="$REMOTEREPOSITORY?a=blob_plain;hb=$commit" + echo "Older posts" + } echo '
' # RSS feed -- 2.11.4.GIT