#!/bin/sh
-url=$(svn info | awk '/^URL:/{gsub("/trunk$", "", $2); print $2}')
-rev=$(svn info | awk '/^Revision:/{print $2}')
+set -e
+rev=$(git rev-parse HEAD)
+last_tag=$(git tag -l | grep '^0' | sort -V | tail -n1)
-version=$(awk -F, '/AC_INIT/{print $2}' configure.ac | tr -d '[ ]')
-tag="$version"
+if [ -n "$1" ]; then
+ tag="$1"
+else
+ tag=$(awk -F, '/AC_INIT/{print $2}' configure.ac | tr -d '[ ]')
+fi
-echo "Making tag: $tag at revision $rev"
-echo ""
-echo "Press ENTER to continue..."
+cat <<EOF
+Making tag: $tag at revision $rev
+
+You probably want to fill git shortlog from last tag $last_tag as annotated tag message:
+
+ git shortlog $last_tag..HEAD
+
+Press ENTER to continue, Ctrl+C to abort
+EOF
read a
-svn cp $url/trunk $url/tags/$tag
+git tag -a "$tag" $rev
+
+cat <<EOF
+
+To push tag, execute:
+
+ git push origin "refs/tags/$tag"
+EOF