#!/bin/sh

## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
##
## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.


set -e

Tag ()
{
	TAG="${1}"
	COMMIT="$(git log | grep -B4 ${TAG} | awk '/^commit / { print $2 }')"
	git-upstream-tag ${TAG} ${COMMIT}
}

for TAG in $(git tag | grep ^upstream)
do
	Tag $(echo ${TAG} | awk -F/ '{ print $2 }')
done
