]> git.ozlabs.org Git - next-scripts/blob - remove_oldest
296d03c5915727c8e9e4ba78ff9c8e579411a2a3
[next-scripts] / remove_oldest
1 #!/bin/bash
2
3 oldest=$(git tag -l next-\* | head -n 1)
4 [ "$oldest" ] || {
5         echo "Could not find oldest next- tag" 1>&2
6         exit 1
7 }
8 od=${oldest#next-}
9 [ "$od" = "$oldest" ] && {
10         echo "Hmmm, oldest next- tag '$oldest' does not start with next-" 1>&2
11         exit 1
12 }
13
14 git tag -d $oldest
15 git push korg --delete $oldest
16
17 exit 0