zcashd/zcutil/cleanup-tags.sh

28 lines
626 B
Bash
Raw Normal View History

2020-10-28 06:08:56 -07:00
#!/usr/bin/env bash
#
# Warning: This deletes tags on "origin", so point that at the right target!
#
# Note: It doesn't delete any local tags.
export LC_ALL=C
set -exu -o pipefail
ZCASH_TAG_RGX='^v[0-9]+.[0-9]+.[0-9]+.z[0-9]+'
MAXJOBS=7
i=0
for nonzctag in $(git ls-remote origin \
| grep refs/tags/ \
| grep -v '\^{}$' \
2020-11-09 15:20:39 -08:00
| sed 's,^.*refs/tags/,,' \
| grep -Ev "$ZCASH_TAG_RGX"
)
do
git push origin ":refs/tags/${nonzctag}" &
i="$(expr "$i" + 1)"
[ "$i" -ge "$MAXJOBS" ] && wait -n
done
wait