From 0abe1a3d1aa617767d97e599e9d6c0b6cf3c096c Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Mon, 14 May 2012 16:56:38 +0200 Subject: [PATCH] more fixes --- misc/tools/conflict-rss.sh | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/misc/tools/conflict-rss.sh b/misc/tools/conflict-rss.sh index 73f0162e..c64fffdb 100755 --- a/misc/tools/conflict-rss.sh +++ b/misc/tools/conflict-rss.sh @@ -21,17 +21,21 @@ to_rss() outdir=$1 name=$2 masterhash=$3 - hash=$4 - branch=$5 - repo=$6 - if [ -n "$repo" ]; then - repo=" in $repo" - fi + masterbranch=$4 + hash=$5 + branch=$6 + repo=$7 filename=`echo -n "$name" | tr -c 'A-Za-z0-9' '_'`.rss outfilename="$outdir/$filename" + masterbranch=`echo -n "$masterbranch" | escape_html` branch=`echo -n "$branch" | escape_html` repo=`echo -n "$repo" | escape_html` + if [ -n "$repo" ]; then + repotxt=" in $repo" + else + repotxt= + fi if ! [ -f "$outfilename" ]; then datetime=`date --rfc-2822` @@ -49,10 +53,11 @@ EOF fi cat >>"$outfilename" < - $branch$repo ($hash) + $branch$repotxt http://git.xonotic.org/?p=$repo;a=shortlog;h=refs/heads/$name/$branch - http://de.git.xonotic.org/conflicts/$filename#$hash-$masterhash + http://de.git.xonotic.org/conflicts/$filename#$hash " >>"$outfilename" @@ -118,6 +123,15 @@ case "$action" in git rev-parse HEAD ) ) + masterbranch=$( + ( + if [ -n "$repodir" ]; then + cd "$repodir" + fi + git symbolic-ref HEAD + ) + ) + masterbranch=${masterbranch#refs/heads/} ( if [ -n "$repodir" ]; then cd "$repodir" @@ -150,7 +164,7 @@ case "$action" in n=divVerent ;; esac - echo "$out" | to_rss "$outdir" "$n" "$masterhash" "$HASH" "$b" "$repo" + echo "$out" | to_rss "$outdir" "$n" "$masterhash" "$masterbranch" "$HASH" "$b" "$repo" echo >&2 " CONFLICT" else echo >&2 " ok" -- 2.39.2