如何防止 git cvsimport 跳过补丁集?

发布于 2024-08-12 10:39:22 字数 530 浏览 5 评论 0原文

我正在尝试将 cvs 模块导入现有的 git 存储库。如果我导入到一个新的存储库中,我可以让它正常工作,但是当我尝试导入到现有的存储库中时,它似乎决定跳过上次提交到我指定的分支之前的所有补丁集 - o。这就是我当前正在尝试的:

git cvsimport -v -p -x -o cvs -d <cvsroot> -k -u <module>

输出的末尾由如下行组成:

skip patchset 26: 1258578534 before 1259081502

如果我删除“-o cvs”,它会失败并显示:

Branch 'origin' does not exist. 
Either use the correct '-o branch' option, 
or import to a new repository.

那么,如何让 git cvsimport 导入 所有内容?

I'm trying to import a cvs module into an existing git repo. I can get it to work properly if I import into a fresh repo, but when I try to import into the existing repo it seems determined to skip all the patchsets that are dated before the last commit to the branch that I've specified with -o. This is what I'm currently trying:

git cvsimport -v -p -x -o cvs -d <cvsroot> -k -u <module>

The end of the output consists of lines like this:

skip patchset 26: 1258578534 before 1259081502

If I drop the "-o cvs", it fails with:

Branch 'origin' does not exist. 
Either use the correct '-o branch' option, 
or import to a new repository.

So, how can I get git cvsimport to import everything?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

清秋悲枫 2024-08-19 10:39:22

导入到新的存储库中,将新分支复制到当前存储库中,然后重新编写分支以位于您已经拥有的分支之后(如果这就是您想要的)。

或者,如果您尝试通过一次转换一个模块来复制多模块 CVS 签出,您可能想尝试一次转换所有模块...

将每个模块转换为 git,拉取每个分支可能会起作用到单个存储库中,然后以每个分支头作为父级创建一个提交,将每个模块放在树中的正确位置。这并不能很好地保留各个模块历史记录中的并发性。

Import into a new repository, duplicate the new branch into your current repository then re-write the branch to sit after what you've already got, if that's what you're after.

Alternatively, if you're trying to replicate a multi-module CVS checkout by converting a module at a time, you may want to try to convert it all at once...

It may work to convert each module to git, pull each branch into a single repository then create a commit with each branch head as a parent, putting each module in the correct place in the tree. This doesn't do a good job of preserving concurrency in the individual modules' history.

春夜浅 2024-08-19 10:39:22

技巧很简单:

  • 自己创建一个新的 git 存储库(不要让 cvsimport 执行此操作)
  • 提交初始提交
  • 将初始提交的日期设置为过去的日期

因此:

$ mkdir my_repo
$ cd my_repo
$ git init
$ touch test
$ git add test
$ git commit -m "Initial commit" --date="1990-01-01 00:00:00"

现在运行 git cvsimport,其中 -C 标志指向您的git 存储库文件夹。 git cvsimport 将跳过分支头部之前带有时间戳的补丁(请参阅 -o 标志)。

The trick is simple:

  • Create a new git repository yourself (don't let cvsimport do this)
  • Commit an initial commit
  • Set the date of that initial commit way back in the past

Hence:

$ mkdir my_repo
$ cd my_repo
$ git init
$ touch test
$ git add test
$ git commit -m "Initial commit" --date="1990-01-01 00:00:00"

Now run git cvsimport with the -C flag pointing to your git repository folder. git cvsimport will skip patches with timestamps before the head of your branch (see -o flag).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文