ClearCase如何识别被劫持的文件? [英] How ClearCase identify hijacked files?

查看:57
本文介绍了ClearCase如何识别被劫持的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人说,被劫持的文件是已删除只读标志的文件。

One says an hijacked file is a file where the "Read Only" flag has been removed.

我尝试删除只读标志(Windows),ClearCase不能将其识别为被劫持。然后,我尝试使用Cygwin touch 而不实际更改任何模式标志的文件。这次,ClearCase警告我,我们被劫持了!

I tried to remove the "Read Only" flag (Windows) and ClearCase does not recognize it as hijacked. Then I tried to touch the file using Cygwin without actually changing any mode flags. This time ClearCase warns me, we've got hijacked!

似乎ClearCase只看文件的时间戳,而不是文件的内容,而不是只读的标志。与git并行工作时,此机制具有非常不好的副作用。例如,如果我这样做:

It seems ClearCase only look at the timestamp of files not their content and not their read-only flags. This mechanism has a very bad side effects when working in parallel with git. For example, if I do this:

 git checkout bar
 git checkout master

与以下内容相同:

 touch foo

因此,ClearCase会认为 foo 并非如此。对于大型项目,这将是非常戏剧性的,不幸的是,我始终使用git在快照视图中快速来回切换。

Thus, ClearCase will think foo was hijacked which is not the case. For huge projects, this would be very dramatic and unfortunately I always use git to quickly switch to back and forth in my snapshot view.

在我的情况下,什么是好的解决方案?

What would be a good solution in my case?

编辑

一个更危险的例子是:

 stat -c 'touch --no-create -d "%y" "%n"' foo > restore_timestamp
 echo "ClearCase will not see this" >> foo
 source restore_timestamp
 rm restore_timestamp


推荐答案

当我在ClearCase和Git之间并行工作时,我不会触及ClearCase中的git repo:我将其克隆到其他位置并从那里开始工作。

When I work in parallel between ClearCase and Git, I don't touch to the git repo within ClearCase: I clone it elsewhere and work from there.

实际上,我没有在ClearCase视图中直接创建git repo :我在外部创建它,从ClearCase视图中添加所有文件(仅用于初始添加: git add --work-tree = / path / to / CC / view

Actually, I don't create a git repo in the ClearCase view directly: I create it outside, adding in it all the file from the ClearCase view (using just for the initial add: git add --work-tree=/path/to/CC/view)

何时需要将ClearCase快照视图与git工作树中,做一个 clearfsimport (在此答案中)从该工作树到ClearCase视图:笨拙地检出/更新并检入已修改的文件。

When it is time to synchronize the ClearCase snapshot view with the git working tree, a do a clearfsimport (as in this answer) from that working tree to the ClearCase view: obnly the modified files are checked out/updated and checked in.

这样,我完全绕过了劫持/不被劫持问题。

That way, I completely bypass the "hijacked/not hijacked" issue.

这篇关于ClearCase如何识别被劫持的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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