[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: git migration party



Hi,

Le 08/02/2014 12:30, Holger Levsen a écrit :

> this still needs update, but here is the migration script I've been using...

About the “convert the remote SVN tags to local Git tags” part: you may
wish to tag the commit just before the Subversion tag (because the way
tags are made in Subversion — creating a copy of a directory without
change):

	git tag -a -m" Converting SVN tags" $tag \
		remotes/svn-import/tags/$tag; echo $tag

So adding ^1 to remotes/svn-import/tags/$tag may worth it:

	git tag -a -m" Converting SVN tags" $tag \
		remotes/svn-import/tags/$tag^1; echo $tag

Also, on a more general case, you may wish to handle “~” in tags, and
you may also wish to keep the original tag commit message. I found stuff
like the following in an backed up .bash_history used to convert the
d-e-doc repository (I don’t remember every bit, but I guess it’s better
to share it anyway):

	git for-each-ref refs/remotes/origin/*%* | cut -d / -f 4- | \
		while read ref;\
		do git tag -a "`echo $ref | sed s/%7E/_/g`" \
		-m"`git log -n1 --oneline refs/remotes/origin/$ref | \
		cut -d' ' -f2-`" "refs/remotes/origin/$ref"^1 ; done

I also tried (without much success) to keep the commiter and date for
the tags, and given the number of tags in d-e-doc, I gave up (but did so
manually for some smaller repositories).

Regards

David



Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: