[projects/nagios-config] update make tag script for git

glen glen at pld-linux.org
Thu Apr 9 15:46:23 CEST 2015


commit 12c61ab584a30241ea3f25daf8daeca98c560477
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Thu Apr 9 16:46:19 2015 +0300

    update make tag script for git

 tag.sh | 33 +++++++++++++++++++++++++--------
 1 file changed, 25 insertions(+), 8 deletions(-)
---
diff --git a/tag.sh b/tag.sh
index 3dd96bc..5ad3735 100755
--- a/tag.sh
+++ b/tag.sh
@@ -1,13 +1,30 @@
 #!/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 --short HEAD)
+last_tag=$(git tag -l | sort -V | tail -n1)
 
-version=$(date +%Y%m%d)
-tag="$version"
+if [ -n "$1" ]; then
+	tag="$1"
+else
+	tag=$(date +%Y%m%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/releases/$tag
+git tag -a "$tag" $rev
+
+cat <<EOF
+
+To push tag, execute:
+
+  git push origin "refs/tags/$tag"
+EOF
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/nagios-config.git/commitdiff/12c61ab584a30241ea3f25daf8daeca98c560477



More information about the pld-cvs-commit mailing list