diff options
author | Matěj Cepl <mcepl@redhat.com> | 2013-08-21 12:59:52 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-03-01 01:23:53 +0100 |
commit | 2769e5827d62a2d17c2fa7a0e14e461b6fddfda1 (patch) | |
tree | ef5491d5d0c930c3efefa1d7836a8cafcbfeb069 /git-svn-fix-tags.sh | |
parent | c359fd903f928ea2f3e204a9df34eb26f3daa36b (diff) | |
download | hlupak-2769e5827d62a2d17c2fa7a0e14e461b6fddfda1.tar.gz |
feat(git-svn-fix-tags): Fix tags in git svn converted repo.
It is supposed that git svn clone had -s --prefix="svn/" set.
Diffstat (limited to 'git-svn-fix-tags.sh')
-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 |