Git Import from Surround SCM?

核能气质少年 提交于 2019-12-18 03:34:35

问题


My company has a large codebase in Surround SCM, which was migrated from SourceSafe a few years ago. We're looking to move to something more suited to our needs, but getting our history out of Surround is proving to be a challenge.

Googling for git importers, I found a good tutorial on custom importers. There also appears to be support for svn, perforce, and many others, but no Surround.

Would it be better to just take a snapshot and start a new git repo? Or is it worth writing a script to get 15+ years of code history?


回答1:


In this kind of scenario, a script can be written, but not for getting all the history.

I would recommend only importing:

  • the major labels (for anything older than a year, or whatever period you feel comfortable you won't need the examine in full because it is so old)
  • all the labels (major and minors) for the last years.

However, migrating to Git requires also a work in order to identify modules or applications within your centralized Surround repository.
Trying to import all those data into one Git repository would be a mistake, unless it is one giant system which can not be developed in parts independently one from another (like the Linux kernel).

See:

  • "What are the Git limits?" and
  • "Transferring legacy code base from cvs to distributed repository (e.g. git or mercurial). Suggestions needed for initial repository design."



回答2:


Finding myself in this exact scenario, I've take it upon myself to write such a custom importer: export-surround-to-git

This method is capable of preserving complete history, timestamps, authors, comments, branches, snapshots, etc.

This script has been tested in a limited number of scenarios, and has proven successful so far. While still a work-in-progress, this may be what you're looking for. It's open-source--so feel free to make improvements to the script on your own!




回答3:


Surround SCM has an SDK. I used this to bring a repository from CVS to Surround. Years later, one team was looking at moving to SVN and asked if I could migrate the repository. I came up with a solution, which consisted of walking the Surround repository and creating an intermediate in-memory database, and then processing it. To ensure dates were right, I would reset the clock on the computer. Before I could fully implment the solution, we decided to keep a floating license for that team for when they needed to look at history and planned on them rethinking the entire organization of their projects. (As an FYI, two years on and that team is still using Surround.)



来源:https://stackoverflow.com/questions/1303887/git-import-from-surround-scm

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!