aboutsummaryrefslogtreecommitdiffstats
path: root/git-svn-fix-tags.sh
blob: 322762075d89ac620eb70a6739110b2d5536ab08 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
set -x
reponame=$(git config svn-remote.svn.url|tr '/' '\n'|tail -n1)

#remotes/tags/release-0-7-8
git for-each-ref refs/remotes/origin/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/origin/tags/$oldref" && \
        git branch -r -d "tags/$oldref" >/dev/null 2>&1
    done