为什么git-cvsimport缺少一个主要的补丁集? [英] Why is git-cvsimport missing one major patchset?

查看:114
本文介绍了为什么git-cvsimport缺少一个主要的补丁集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是的一个后续问题我可以查看cvsps的输出(保存在我的〜/ .cvsps目录中),并查看一个主要复杂提交的补丁集。但是当我做cvsimport来更新我现有的git仓库时,这个提交不会显示出来。我知道git-cvsimport会忽略比10分钟更新的补丁集,以避免导入不完整的CVS提交。我想我也听说它会跳过相关分支无法识别的补丁集。还有什么原因可能导致git-cvsimport忽略我的提交?我怎么能调试这个?



以下是一些cvsps输出:

  patchset:50064 
日期:1238445635
作者:skiphoppy
标记:
tag_flags:0
分支:HEAD
branch_add:1
descr:
我的日志消息

- = - END CVSPS DESCR - = -
成员:
文件:ordinaryChangedFile; pre_rev:1.44; post_rev:1.45;死:0; branch_point:0
file:newFileRenamedAndModifiedFromOldFile; pre_rev family:宋体; post_rev:1.1;死:0; branch_point:0
file:deletedFileGoneBecauseRenamed; pre_rev:1.2; post_rev:1.3;死:1; branch_point:0
...

那branch_add:1行有什么关系它?整个库中只有9个这样的提交;其他50090提交说branch_add:0除此之外,我不知道从cvsps或git-cvsimport的角度来看差异是什么。提交很复杂,涉及重命名几个文件并进行相关的内容修改。 CVS绝对难以处理。对于git来说,当然是一个快照,但是当真正的后端是CVS时,很难用git来处理。



我必须执行相同类型的复杂提交。次,并且我无法每次花费4个半小时从CVS重新导入一个全新的git存储库,因为cvsimport无法看到我的提交。



<更重要的是,我很害怕这样一个事实,即我每天运行的git-cvsimport(我打算将其放入cron中,或者甚至编写一个守护进程,每五分钟运行一次)可能会 错过 将来会提交!我发现没有办法让现有的存储库捡起这些提交;我只能在一个全新的仓库中运行git-cvsimport,并永远等待,在我处于使用状态时会丢失许多其他分支机构。

解决方案那么,这可能是问题所在。我的git-cvsimport行如下所示:

  git cvsimport -px ... 

-px应该将-x选项传递给cvsps,以告诉它忽略它从先前运行中留下的缓存输出。我认为这样做的主要原因是,最后几个补丁集可能不完整,将在下次运行时被抛出并完成。发现可能有更多的问题,它修复了,这可能是其中之一。



我学会了如何从这个博客文章,它目前是谷歌最高点击 git cvs。这只是在上面的过程中,我试图通过Perl调试器从cvsps的输出中运行git-cvsimport,我必须检查并查看哪些参数实际上将用于cvsps。我知道cvsps正在运行,如下所示:

  cvsps --norc x --cvs-direct ... 

而不是:

  cvsps --norc -x --cvs-direct ... 

我通过实验验证我得到了cvsps的不同输出,并且缺少一些补丁集(我不知道该模式是什么),当传递x而不是-x时。由于墨菲的法律,cvsps似乎没有报告这是一个问题,而git-cvsimport从来没有看到它。

因此无论如何,git cvsimport需要运行像这样:

  git cvsimport -p -x ... 

这个版本的仓库在这个时候已经完全泄露了,但是我已经能够迫使最后一个问题提交到它们中了(一些早期的提交是虽然失踪)。所以我再一次经历了四小时的导入过程,我希望这将是它!



最后一个提示:Windows上的git-cvsimport似乎并没有工作。虽然我收到了一棵类似于我们项目当前状态的树,但我得到的提交数量不到10%。它似乎缺乏几乎所有的历史......

This is a followup to a previous question of mine.

I can look through the output of cvsps (saved in my ~/.cvsps directory) and see a patchset for a major, complicated commit. But this commit does not show up when I do cvsimport to update my existing git repository. I know that git-cvsimport will ignore patchsets that are newer than 10 minutes, in an effort to avoid importing a CVS commit that is incomplete. I think I've also heard that it will skip patchsets for which the associated branch cannot be identified. What other reasons might be causing git-cvsimport to be ignoring my commit? How can I debug this?

Here is a little bit of the cvsps output:

patchset: 50064
date: 1238445635
author: skiphoppy
tag: 
tag_flags: 0
branch: HEAD 
branch_add: 1
descr:
My log message

-=-END CVSPS DESCR-=-
members:
file:ordinaryChangedFile; pre_rev:1.44; post_rev:1.45; dead:0; branch_point:0
file:newFileRenamedAndModifiedFromOldFile; pre_rev:INITIAL; post_rev:1.1; dead:0; branch_point:0
file:deletedFileGoneBecauseRenamed; pre_rev:1.2; post_rev:1.3; dead:1; branch_point:0
...

Does that branch_add: 1 line have anything to do with it? There are only 9 such commits in the entire repository; the other 50090 commits say branch_add: 0. Other than that I don't know what the differences are from a cvsps or git-cvsimport point of view. The commit was complicated, involving renaming several files and making associated content modifications. Definitely difficult for CVS to handle. A snap for git, of course, but hard for git to handle when the real backend is CVS.

I've got to perform the same type of complicated commit three more times, and I can't afford to spend 4 1/2 hours each time to reimport a brand new git repository from CVS due to cvsimport not being able to see my commit.

More importantly, I'm frightened by the fact that my daily runs of git-cvsimport (which I intended to put into cron, or even write a daemon to run every five minutes or so) might miss commits in the future! I have found no way to git an existing repository to pick up these commits; I can only run git-cvsimport in a brand new repository and wait forever, losing the use of many of my other branches while I'm at it.

解决方案

Well, this may be the problem. My git-cvsimport lines look like this:

git cvsimport -p x ...

The -p x is is supposed to pass the -x option to cvsps to tell it to ignore the cached output that it left lying around from previous runs. I thought the main reason to do that was so that the last few patchsets, which might be incomplete, will be thrown out and completed the next time you run. Turns out there may be more issues that it fixes, and this may be one of them.

I learned to run git cvsimport this way from this blog entry, which is currently one of the highest hits on Google for "git cvs." It was only in the process above, where I was trying to run git-cvsimport through the Perl debugger on output from cvsps, that I had to check and see what arguments were really going to cvsps. I learned cvsps was being run like this:

cvsps --norc x --cvs-direct ...

Instead of:

cvsps --norc -x --cvs-direct ...

And I experimentally verified that I get different output from cvsps, with some patchsets missing (I have no idea what the pattern is), when x is passed instead of -x. Thanks to Murphy's law, cvsps doesn't seem to report that this was a problem, and git-cvsimport never sees it.

So anyway, git cvsimport needs to be run like this:

git cvsimport -p -x ...

My previous versions of this repository are completely hosed at this point, but I have been able to force the last of the problem commits into them (some of the earlier commits are missing, though). So I get to go through the four-hour import process one more time, and I'm hoping that will be it!

One last tip: git-cvsimport on Windows doesn't seem to work at all. I got less than 10% of the number of commits, although I did wind up with a tree that resembles the current state of our project. It just seems to be lacking almost all the history...

这篇关于为什么git-cvsimport缺少一个主要的补丁集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆