Is there a way to checkout a specific subversion tag or branch in a Git mirror of a Subversion repository?
Mailing lists / lazarus / 2015-03
Is there a way to checkout a specific subversion tag or branch in a Git mirror of a Subversion repository?
6 messages · 3 people ·
- GGraeme Geldenhuys 3
- Vvfclists . 2
- MMichael Van Canneyt 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
vfclists . wroteIs there a way to checkout a specific subversion tag or branch in a Git mirror of a Subversion repository?
If your Git mirror cloned all the details you need (trunk, branches and tags), then yes. Simply checkout the branch you want using "git checkout -b <name_of_branch>". Setting up such a git mirror is quite hard though (dependent on how SubVersion was abused) - at least it was when I last tried to do it.
Some very clever git mirrors even translate SubVersion tags into Git tags. But unfortunately that processes is mostly flawed because SubVersion has no context of what a "tag" really is. To Subversion, it is just another branch. And to make matters worse, many SubVersion repos make extra commits to those tag-type branches. eg: the Lazarus and I believe the FPC project does this (or used to). In terms of Git, a tag is a pointer to one specific snapshot (commit) in a repository.
Regards,
- Graeme -
Graeme Geldenhuys wrote 9 lines
I did it once for FPC, the process ran for more than 24 hours.
Michael.
If your Git mirror cloned all the details you need (trunk, branches and tags), then yes.…
Graeme Geldenhuys wrote 10 lines
I am using your Git mirror :). Does it clone all the necessary details? -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150326/819feaab/attachment-0001.html>
I did it once for FPC, the process ran for more than 24 hours. Michael.
Michael Van Canneyt wroteI did it once for FPC, the process ran for more than 24 hours.
That is also caused by the fact that SubVersion makes complete copies of a branch when branching - hence the common statement and comparison that Git branches are cheap and instant. The HTTP protocol is also not the most efficient for this - the git:// protocol in comparison is magnitudes faster. Maybe subversion has improved in recent times, but I stopped following SubVersion development many years ago.
When I initially made the FPC Git mirror on Github I decided to restrict it to the Trunk branch (I had no need for the branches). The time it takes is also dependent on your internet connection (South Africa has very slow internet), but it was done in a day during office hours.
If you are converting the repo from SubVersion to Git (a permanent move), I recommend you do the above, then simply create the required branches in git and copy each checked out SubVersion branch over the Git branch. Then do a git commit which will be the diffs. Then continue development in Git from there onwards.
Alternatively (more work, but keeps the SubVersion history of branches) is to clone each SubVersion branch independently, then do a sub-tree merge into the original Git (trunk) mirror.
There are other solutions too, but I found the above usage the easiest to do with good results.
Regards,
- Graeme -
On 26 March 2015 at 09:55, Graeme Geldenhuys I am using your Git mirror :). Does it clone…
vfclists . wroteI am using your Git mirror :). Does it clone all the necessary details?
No. I used to track some branches and tags (both for FPC and Lazarus) - but then I discovered the abuse of SubVersion usage and just gave up. At that stage it wasn't an automated setup, so was too much work for me with no real benefit. Sorry.
You can always ask git to clone whatever branches directly from SubVersion. You can also tell git to limit the history (eg: start from 7 days ago), which makes the clone process magnitudes faster. If you want more details I can help you further outside the mailing list. Just send me a private email.
Regards,
- Graeme -
