From 43d512c30a2d0d1d43a9f176276d7b84665bdff7 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 27 Aug 2010 14:11:54 -0300 Subject: [PATCH] Only use commits that change anything we care about. Accelerates full build of ben-wpan/atrf by 70%, build from cache by 35%. - scripts/schhist2web: only extract commits that change a .pro, .sch, or .lib file - scripts/schhist2web: when building the differences, skip commits missing in cache - scripts/schhist2web: use last cached commit as head instead of asking git for the current HEAD --- scripts/schhist2web | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/schhist2web b/scripts/schhist2web index 9b128c3..684605c 100755 --- a/scripts/schhist2web +++ b/scripts/schhist2web @@ -122,8 +122,11 @@ $no_cache && rm -rf "$cache" mkdir -p "$out/names" mkdir -p "$cache" +head= for n in $first `git rev-list --reverse $first..HEAD`; do -echo Processing $n + git show --pretty=format:'' --name-only $n | + egrep -q '\.sch$|\.pro$|\.lib$' || continue + echo Processing $n new=`gitenealogy "$dir/$sch" | sed "/^$n /s///p;d"` if [ ! -z "$new" ]; then echo Name change $schname to $new 1>&2 @@ -141,8 +144,14 @@ echo Processing $n touch "$out/names/"`basename "$m" .ppm` done trap 0 + head=$n done +if [ -z "$head" ]; then + echo "no usable head found" 2>&1 + exit 1 +fi + index="$out/index.html" cat <"$index" @@ -155,9 +164,9 @@ for m in `ls -1 "$out/names"`; do echo "$m" >>"$index" done -head=`git rev-list HEAD~1..HEAD` next="$head" for n in `git rev-list $first..HEAD~1` $first; do + [ -d "$cache/ppm_$n" ] || continue empty=true s="" mkdir -p "$out/diff_$next" "$out/thumb_$next" @@ -201,7 +210,7 @@ $s EOF mkdir -p "$out/diff_$next" "$out/thumb_$next" echo "
"
-	    git log --pretty=short $n..$next |
+	    git log --pretty=short $next~1..$next |
 	      sed 's/&/&/g;s//\>/g'
 	    echo "
" ) >>"$index"