简体   繁体   English

从 Surround SCM 导入 Git?

[英]Git Import from Surround SCM?

My company has a large codebase in Surround SCM, which was migrated from SourceSafe a few years ago.我的公司在 Surround SCM 中有一个大型代码库,它是几年前从 SourceSafe 迁移而来的。 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.我们正在寻求更适合我们需求的东西,但事实证明,让我们的历史脱离 Surround 是一个挑战。

Googling for git importers, I found a good tutorial on custom importers .谷歌搜索 git 导入器,我找到了一个关于自定义导入器的好教程 There also appears to be support for svn, perforce, and many others, but no Surround.似乎也支持 svn、perforce 等,但没有 Surround。

Would it be better to just take a snapshot and start a new git repo?只拍一个快照并开始一个新的 git repo 会更好吗? Or is it worth writing a script to get 15+ years of code history?或者是否值得编写一个脚本来获得 15 年以上的代码历史?

Finding myself in this exact scenario, I've take it upon myself to write such a custom importer: export-surround-to-git在这个确切的场景中发现自己,我自己编写了这样一个自定义导入器: 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!它是开源的——所以你可以随意对自己的脚本进行改进!

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.但是,迁移到 Git 还需要一项工作,以便识别集中化 Surround 存储库中的模块或应用程序。
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).尝试将所有这些数据导入一个Git 存储库将是一个错误,除非它是一个无法独立开发的巨型系统(如 Linux 内核)。

See:看:

Surround SCM has an SDK. Surround SCM 有一个 SDK。 I used this to bring a repository from CVS to Surround.我用它把一个存储库从 CVS 带到了 Surround。 Years later, one team was looking at moving to SVN and asked if I could migrate the repository.多年后,一个团队正在考虑迁移到 SVN,并询问我是否可以迁移存储库。 I came up with a solution, which consisted of walking the Surround repository and creating an intermediate in-memory database, and then processing it.我想出了一个解决方案,包括遍历 Surround 存储库并创建一个中间内存数据库,然后对其进行处理。 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.) (作为仅供参考,两年过去了,该团队仍在使用 Surround。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM