summaryrefslogtreecommitdiff
path: root/update_tags
diff options
context:
space:
mode:
authorTzafrir Cohen <tzafrir@debian.org>2014-01-22 14:58:44 +0200
committerTzafrir Cohen <tzafrir@debian.org>2014-01-22 14:58:44 +0200
commit1825d059deb7f1456110a94e8a3a7ba0e782d37c (patch)
treeac1cce541db738b1e0b76fa26d554f57cdd169b0 /update_tags
Initial set of toolsHEADmaster
Diffstat (limited to 'update_tags')
-rwxr-xr-xupdate_tags12
1 files changed, 12 insertions, 0 deletions
diff --git a/update_tags b/update_tags
new file mode 100755
index 0000000..31ad8a4
--- /dev/null
+++ b/update_tags
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+git branch -r | egrep 'tags/(|PR)[0-9]' | sed -e 's"tags/\(.*\)"& v\1"' \
+ | while read branch tag; do
+ if ! git show-ref -q "$tag"; then
+ echo "Tagging $tag from $branch"
+ git tag $tag $branch
+ elif [ `git show-ref -s $branch` != `git show-ref -s $tag` ]; then
+ echo "Updating $tag from $branch"
+ git tag -f $tag $branch
+ fi
+ done