This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch master in repository maintenancescripts. commit 6d2ce2fff0e86dbebfd9a95ec3e1e95c18b52f16 Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Feb 23 21:30:20 2015 +0100 git/hooks/x2go-post-receive-close-bugs: change tabs to spaces, add quoting and curly braces around variables in big block. --- git/hooks/x2go-post-receive-close-bugs | 61 ++++++++++++++++---------------- 1 file changed, 31 insertions(+), 30 deletions(-) diff --git a/git/hooks/x2go-post-receive-close-bugs b/git/hooks/x2go-post-receive-close-bugs index 4ff4478..28217c9 100755 --- a/git/hooks/x2go-post-receive-close-bugs +++ b/git/hooks/x2go-post-receive-close-bugs @@ -77,37 +77,38 @@ EOF cat "$diff") | /usr/sbin/sendmail -oi -t } +## FIXME ## really go through this some time... while read oldrev newrev refname; do - if echo $refname | egrep "refs/tags/" >/dev/null; then - # find the last tag on this branch - tag=${refname/refs\/tags\//} - oldrev=$(git rev-parse $tag)^ - # rewind back from current ref back to the previous tag we find - while ! git describe $oldrev --exact-match 2>/dev/null; do oldrev=${oldrev}^; done - oldrev=$(git rev-parse $oldrev) - oldtag=$(git tag --contains $oldrev | head -n1) - - c="$tempdir/$newrev.changelog" - d="$tempdir/$newrev.diff" - - git show ${newrev}:debian/changelog >"$c" 2>/dev/null - cat "$c" | sed 's/Fixes:/Closes:/i' | dpkg-parsechangelog -l- | sed 's/Closes:/Fixes:/i' | - sed -e 's/^Source: /X2Go Component: src:/' \ - -e 's/-0~x2go[0-9]//' \ - -e 's/-0$//' \ - -e 's/^Distribution: unstable/Status: RELEASE/' \ - -e 's/ unstable;/ RELEASED;/' \ - -e 's/^Distribution: UNRELEASED/Status: PREVIEW/' \ - -e 's/ UNRELEASED;/ PREVIEW;/' \ - | egrep -v "^(Urgency:|Maintainer:).*" > "$d" - #git diff ${oldrev}..${newrev} -- debian/changelog >"$d" - version=`cat "$c" | sed 's/Fixes:/Closes:/i' | dpkg-parsechangelog -l- | sed -rne 's/^Version: *//pi' -e 's/[0-9]+://' | cut -d"-" -f1` - bugs=`cat "$c" | sed 's/Fixes:/Closes:/i' | dpkg-parsechangelog -l- | sed -rne 's/^Closes: *//pi'` - for bug in $bugs; do - info "Marking X2Go issue #$bug as resolved/closed." - send_mail $bug "$version" "$oldrev" "$newrev" "$d" - done - fi + if echo "${refname}" | egrep "refs/tags/" >/dev/null; then + # find the last tag on this branch + tag="${refname/refs\/tags\//}" + oldrev="$(git rev-parse "${tag}")^" + # rewind back from current ref back to the previous tag we find + while ! git describe "${oldrev}" --exact-match 2>/dev/null; do oldrev="${oldrev}^"; done + oldrev="$(git rev-parse "${oldrev}")" + oldtag="$(git tag --contains "${oldrev}" | head -n1)" + + c="${tempdir}/${newrev}.changelog" + d="${tempdir}/${newrev}.diff" + + git show "${newrev}:debian/changelog" >"${c}" 2>/dev/null + cat "${c}" | sed 's/Fixes:/Closes:/i' | dpkg-parsechangelog -l- | sed 's/Closes:/Fixes:/i' | + sed -e 's/^Source: /X2Go Component: src:/' \ + -e 's/-0~x2go[0-9]//' \ + -e 's/-0$//' \ + -e 's/^Distribution: unstable/Status: RELEASE/' \ + -e 's/ unstable;/ RELEASED;/' \ + -e 's/^Distribution: UNRELEASED/Status: PREVIEW/' \ + -e 's/ UNRELEASED;/ PREVIEW;/' \ + | egrep -v "^(Urgency:|Maintainer:).*" > "${d}" + #git diff "${oldrev}..${newrev}" -- "debian/changelog" >"${d}" + version="$(cat "${c}" | sed 's/Fixes:/Closes:/i' | dpkg-parsechangelog -l- | sed -rne 's/^Version: *//pi' -e 's/[0-9]+://' | cut -d"-" -f1)" + bugs="$(cat "${c}" | sed 's/Fixes:/Closes:/i' | dpkg-parsechangelog -l- | sed -rne 's/^Closes: *//pi')" + for bug in ${bugs}; do + info "Marking X2Go issue #${bug} as resolved/closed." + send_mail "${bug}" "${version}" "${oldrev}" "${newrev}" "${d}" + done + fi done # vi: et -- Alioth's /srv/git/_hooks_/post-receive-email on /srv/git/code.x2go.org/maintenancescripts.git