summaryrefslogtreecommitdiff
path: root/update_tags
blob: 31ad8a42e116a329e9561c3ed7d623a6d1725459 (plain)
1
2
3
4
5
6
7
8
9
10
11
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