#!/bin/sh set -x repourl="http://radeonhd.lauft.net/xf86-video-radeonhd.git/" sedhtml="s/&/\&/g; s/@/\@/g; s//\>/g;" rm -f "patches/"*/[0-9][0-9][0-9][0-9]-*.patch rmdir "patches/"* while read start from to dir restofline do if echo "$start" | grep '^#' > /dev/null; then continue; fi git format-patch -o "patches/$dir" --start-number "$start" "$from".."$to" if test "x$to" = "x$dir"; then { echo "

${to} branch

" echo "

git pull ${repourl} ${to}

" } > "patches/$dir/HEADER.html" echo "IndexIgnore .." > "patches/$dir/.htaccess" { sedcmds="" for f in "patches/$dir/"[0-9]*.patch; do b="$(basename "$f")" commit="$(sed -n '1s/^From \([a-z0-9]\{1,\}\).*/\1/p' "$f")" sedcmds="${sedcmds} s|\(${commit}\)|\1|;" echo "AddDescription \"$(sed -n 's|^Subject: [PATCH[^\]*] \(.*\)|\1|p' "$f" | sed "${sedhtml}")\" ${b}" >> "patches/$dir/.htaccess" done echo "$commits" echo "
"
		git log --stat "${from}..${to}" | sed "${sedhtml}${sedcmds}"
		echo "
" } > "patches/$dir/README.html" fi done<