#!/bin/sh
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
git tag -a "$tag" $rev
-git push --dry-run origin "refs/tags/$tag"
+
+cat <<EOF
+
+To push tag, execute:
+
+ git push origin "refs/tags/$tag"
+EOF