简体   繁体   English

将CVS存储库导入GIT结果中,导致一些与时间戳相关的误导性行为

[英]Import a CVS repository into GIT results in some misleading behaviors related to timestamps

I have used git cvsimport to import my CVS repository into a brand new GIT one. 我使用git cvsimport将我的CVS存储库导入到全新的GIT存储库中。

Unfortunately, in some cases some commits have been reported in a wrong order. 不幸的是,在某些情况下,某些提交报告的顺序错误。

Eg I had two CVS revisions of a file, rev1.1 at 11.39am and rev1.2 at 11.42am; 例如,我有两个CVS版本的文件,rev1.1在11.39am和rev1.2在11.42am; in GIT, I can see a commit at 11.42am (with content equal to rev1.2) and a subsequent one at 11.45am (with content equal to rev1.1). 在GIT中,我可以看到11.42am的提交(内容等于rev1.2)和随后的提交在11.45am(内容等于rev1.1)。

I'm aware of the known issue stated in the cvsimport man page 我知道cvsimport手册页中陈述的已知问题

If timestamps of commits in the cvs repository are not stable enough to be used for ordering commits changes may show up in the wrong order. 如果cvs存储库中提交的时间戳不够稳定,无法用于订购提交,则更改可能会以错误的顺序显示。

but I cannot understand what does stable enough mean. 但我无法理解足够稳定的意思。

Moreover, it would be great if anyone could provide me a workaround for this problem. 而且,如果有人能为我提供解决这个问题的方法,那就太好了。

Thank you very much 非常感谢你

cghersi cghersi

Is very easy to cheat git into timestamp, as it checks only the local time, so probably the cvs checked the time into the order the tags was set. 很容易将git欺骗到时间戳中,因为它仅检查本地时间,因此cvs可能会检查标签设置顺序的时间。

But a workaround to this is use cherry-pick . 但是解决这个问题的方法是使用cherry-pick This commands is almost a copy-paste from commits, so you can simple give a checkout to a commit from rev1.1 and there use the cherry-pick into the commit lost after the rev1.2. 这个命令几乎是来自提交的复制粘贴,所以你可以简单地从rev1.1中提交一个checkout ,并在rev1.2之后使用cherry-pick进入提交。 Than after use a rebase -i just to erase/squash the duplicated commit after the rev1.2. 比使用了一个rebase -i只是为了擦除/压缩rev1.2之后的重复提交。 As using rebase/cherry-pick, the commit's tree will request a sad push -f into the branch to fix everything. 使用rebase / cherry-pick时,提交的树将请求一个悲伤的push -f进入分支来修复所有内容。

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

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