clearcase快照被劫持的文件:如何检出/检入更改的文件 [英] clearcase snapshot hijacked files : how to checkout/checkin changed files

查看:282
本文介绍了clearcase快照被劫持的文件:如何检出/检入更改的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

手提箱很烂。看来我不能只是快速保存对项目的修改。很快,我的意思是不到1秒。

Clearcase sucks a lot. It seems I cannot just save modifications to my project quickly. By quickly I mean in less than 1 second.

我发现的解决方案是使用连用clearcase + git。我使用快照视图是因为我可以轻松劫持我的文件,而不必每次执行重构时都检出项目中的所有文件。

The solution I have found is to use the combo clearcase + git. I'm using snapshots views because I can easily hijack my files without having to checkout all the files in my project every time I want to do refactoring.

问题是,当我玩git并在新旧版本之间导航时,clearcase认为所有文件都被劫持了。然后,我需要执行以下操作。

The problem is, when I play with git and navigate between new and old versions, clearcase think all the files are hijacked. Then I need to do the following.


  1. cleartool更新

  2. cleartool ls -recurse | grep被劫持 | xargs cleartool diff -prev [...]>已更改

  3. cat已更改| xargs cleartool co -nc

  4. cat已更改| xargs cleartool ci -c'一些单词...'

  5. rm ** / *。keep

  6. git checkout。

  1. cleartool update
  2. cleartool ls -recurse | grep "hijacked" | xargs cleartool diff -prev [...] > changed
  3. cat changed | xargs cleartool co -nc
  4. cat changed | xargs cleartool ci -c 'some words...'
  5. rm **/*.keep
  6. git checkout .

由 clearcase push组成的操作(使用git大约需要2秒钟)将持续至少10分钟。我只看到有关此问题的两种解释:

The operation consisting of "clearcase push" which takes about 2 seconds with git will last for at least 10 minutes. I see only two explanation regarding this issue:


  1. 我真的不知道如何使用clearcase

  2. 公文包真的很烂!

有人知道如何快速结帐,然后用Clearcase而不是UCM版本签入修改的被劫持文件吗?

Does somebody knows how to quickly checkout then checkin modified hijacked files with Clearcase not UCM version ?

编辑:

遵循 Vonc 我制作了一个使用 clearfsimport 的脚本:

Following the advices of Vonc I made a script that uses clearfsimport:

#!/bin/bash/
OUT="$(mktemp -d)"
DST=/vob/project_root/
echo -e "\nCreating temporary folder..."
echo $OUT

echo -e "\nCopying relevant elements..."
find . | grep -E '.*?\.(c|h|inc|asm|mac|def|ldf|rst)$' | xargs -I % cp --parents % $OUT
DOUT=$(cygpath -d $OUT/*)
DDST=$(cygpath -d $DST)
echo -e "\nImporting new elements to cleacase..."
clearfsimport -rec -unco -nset $DOUT $DDST

echo -e "\nRemoving temporary files..."
rm -rf $OUT   

我需要复制存储库的原因是 clearfsimport 无法直接排除文件或目录,并且通配符选项不适用于此工具。它按原样采用目录树。另外,我也不想从工作目录中删除所有未版本控制的文件,例如目标文件,甚至是.git。

The reason why I need to make a copy of my repository is that clearfsimport cannot directly exclude files or directories and wildcard options does not work with this tool. It takes a directory tree as is. Also I do not want to remove all my unversionned files such as object files or even the .git from my working directory.

我认为我可以通过以下方式使此脚本更好用git识别自上次执行脚本以来更改的所有文件。

I think I can make this script much better by identifying with git all the files that changed since the last execution of my script. Might be a bit tricky to do...

我也可以使用.gitignore设置匹配文件的模式

Also I can set my matching files pattern using .gitignore

也许其他人已经制作了这样的脚本...

Perhaps others already made such scripts...

推荐答案

您从git工作树更新ClearCase文件的顺序几乎是最佳,这意味着它不会更快。

Your sequence for updating ClearCase file from a git working tree is pretty much the "optimal" one, meaning it won't get much faster.

使用ClearCase和Git clearfsimport ,其中2个ClearCase视图。

One alternative I have been playing with when using ClearCase and Git is clearfsimport, with 2 ClearCase views.


  • 一个快照视图用于更新一组文件,然后进行劫持(供git工作树使用)

  • 一个快照(或实际上是动态的)视图将成为接收者,即在第一棵工作树中所做的更改的目的地。

clearfsimport 允许您使用任何工作树(是否由ClearC管理)例如,它无关紧要),然后将其导入ClearCase视图中(它可以是动态视图),

clearfsimport allows you to take any working tree (managed or not by ClearCase, it doesn't care), and import it in a ClearCase view (it can be a dynamic view, by the way), and:


  • 仅签出已修改的文件

  • 仅保留相同的文件

  • 在ClearCase视图中删除/添加在工作树中删除/创建的文件

这是一个比扩散所有内容更有效的过程,它应该很多更快。

这并不意味着它很快

毕竟,它仍然是 ClearCase

It is a process more efficient than diff'ing everything, and it should be much faster.
That doesn't mean it is fast.
It is still, after all, ClearCase.

这篇关于clearcase快照被劫持的文件:如何检出/检入更改的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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