From d34363d8e9a7b8fb91681aa18fd8c41cd948afe2 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Thu, 22 Jan 2009 08:09:24 +0100 Subject: [PATCH] Avoid changing index.html and blog.css unnecessarily As the URLs change with the commit name in it, we have to update the generated files all the time. This is only necessary, though, if an image has been committed in the meantime. So determine the last commit touching an image, and use that commit for the links. Signed-off-by: Johannes Schindelin --- upload.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/upload.sh b/upload.sh index 26034701b8..dbb788b939 100755 --- a/upload.sh +++ b/upload.sh @@ -245,7 +245,12 @@ commit_new_images || die "Could not commit new images" # to find the images reliably, we have to use the commit name, not the branch -URL="$REMOTEREPOSITORY?a=blob_plain;hb=$(git rev-parse --verify $BRANCH);f=" +# we use the latest commit touching an image file. +IMAGEFILES="$(git ls-files | + grep -v '\.\(css\|html\|gitignore\|in\|sh\|txt\)$')" +REV=$(git rev-list -1 HEAD -- $IMAGEFILES) +test -z "$REV" && REV=$BRANCH +URL="$REMOTEREPOSITORY?a=blob_plain;hb=$REV;f=" # Rewrite the URL in the .css file if we're not running dry if test -z "$DRYRUN" -- 2.11.4.GIT