[debian-edu-commits] debian-edu/ 01/01: make_git.sh: add support for preserving tags

Mike Gabriel sunweaver at debian.org
Tue Feb 25 19:59:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

sunweaver pushed a commit to branch master
in repository d-e-gitscripts.

commit a5a2a035a558effe7dfa267b07400510cab1c686
Author: Mike Gabriel <sunweaver at debian.org>
Date:   Tue Feb 25 19:58:19 2014 +0000

    make_git.sh: add support for preserving tags
---
 svn-migration/make_git.sh | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/svn-migration/make_git.sh b/svn-migration/make_git.sh
index 5ddfde9..a0379d9 100755
--- a/svn-migration/make_git.sh
+++ b/svn-migration/make_git.sh
@@ -40,15 +40,21 @@ git svn clone --no-metadata \
 
 # convert the remote SVN tags to local Git tags
 cd $PACKAGE
-for tag in $(git branch -r | grep "tags/" | sed 's#svn-import/tags/##'); do   
-	git tag -a -m" Converting SVN tags" $tag remotes/svn-import/tags/$tag; echo $tag 
+
+git for-each-ref --format="%(refname)" refs/remotes/svn-import/tags/ |
+while read tag; do
+    echo "Preserving tag \"$tag\""
+    GIT_COMMITTER_DATE="$(git log -1 --pretty=format:"%ad" "$tag")" \
+    GIT_COMMITTER_EMAIL="$(git log -1 --pretty=format:"%ce" "$tag")" \
+    GIT_COMMITTER_NAME="$(git log -1 --pretty=format:"%cn" "$tag")" \
+    git tag -m "$(git for-each-ref --format="%(contents)" "$tag")" \
+                ${tag#refs/remotes/svn-import/tags/} "$tag"
 done
+
 cd ..
 
-echo now adding alioth as the origin remote...
+echo Now adding Alioth's git.debian.org as the origin remote...
 git remote add origin ssh://git.debian.org/git/debian-edu/${PKGTEAM}/${PACKAGE}.git
-echo now run
+echo Now run:
 echo git push origin master
 echo git push --tags origin
-
-echo FIXME: dont push yet - the tags should be preserved as discussed in http://thomasrast.ch/git/git-svn-conversion.html

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/d-e-gitscripts.git



More information about the debian-edu-commits mailing list