for tag in $(git branch | grep tag); do
    echo "branch=$tag"
    tagname=$(echo "$tag" | sed -e 's/^tag-//')
    echo "tagname=$tagname"
    tagger=$(git show "$tag" | grep ^Author | sed -e 's/^Author:[[:space:]]*//')
    echo "tagger=$tagger"
    date=$(git show "$tag" | grep ^Date | sed -e 's/^Date:[[:space:]]*//')
    echo "date=$date"
    message="tagging version $tagname"

    GIT_COMMITTER_DATE="$date" git tag -s -u "Roger Leigh <rleigh@debian.org>" -m "$message" "$tagname" "$tag"

    git branch -d "$tag"
done