diff options
-rwxr-xr-x | git-svn-fix-tags.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/git-svn-fix-tags.sh b/git-svn-fix-tags.sh new file mode 100755 index 0000000..2af9f14 --- /dev/null +++ b/git-svn-fix-tags.sh @@ -0,0 +1,12 @@ +#!/bin/sh +reponame=$(git config svn-remote.svn.url|tr '/' '\n'|tail -n1) + +git for-each-ref refs/remotes/svn/tags | cut -d / -f 5- \ + | while read oldref + do + ref=$(echo $oldref|sed -e "s/$reponame-*//") + echo "Converting branch $oldref to tag ${ref}." + git tag -a "$ref" -m"say farewell to SVN" \ + "refs/remotes/svn/tags/$oldref" && \ + git branch -r -d "svn/tags/$oldref" >/dev/null 2>&1 + done |