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

Re: Alioth - Convert SVN repo to Git



hiya,

On Tue, Mar 24, 2009 at 12:29:08PM +0100, Sandro Tosi wrote:
> I tried to put together a guide[1] to convert SVN repo to Git hosted on Alioth.
> 
> [1] http://wiki.debian.org/Alioth/Git#ConvertaSVNAliothrepositorytoGit
> 
> Since I'm not that expert in Git, I'd like to ask you for its review.
> The conversion and all other steps are working, but there's room for
> improvement, I think.

it's really useful info!  one thing that might be worth mentioning wrt the
tag conversion:

	for t in `git branch -r | grep 'tags/' | sed s_tags/__` ; do
	     git tag $t tags/$t^
	     git branch -d -r tags/$t
	done

the use of "^" is something i hadn't thought of which uses the parent
(i.e. pre-copy) commit which can then still be associated with a
development branch instead of a headless commit. 

however, it makes the assumption that no further changes have been done on
a tag.  since svn has no concept of a read-only tag, it's quite possible
(and i've seen this in the wild) that further changes are made on the
"tags/$t" branch.  this would create a broken tag which is both headless
and referencing the wrong commit/state.

i have a suspicion that there's a more general way to catch this[1], perhaps
by rebasing each of these branches into a single commit before tagging
the parent[2], or maybe using git filter-branch (which is still a dark
mysterious art to me that i hope to learn soon).  perhaps someone with more
than my meager level of git-fu could chime in :)


	sean

[1] alternatively one could solve #501761 and i guess this'd be moot.
[2] i.e. a no-op for tags with only the "copy" commit, and the rest are
    transformed into something equivalent to such a commit.

Attachment: signature.asc
Description: Digital signature


Reply to: