Clearcase sucks a lot. It seems I cannot just save modifications to my project quickly. By quickly I mean in less than 1 second.
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.
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.
- cleartool update
- cleartool ls -recurse | grep "hijacked" | xargs cleartool diff -prev [...] > changed
- cat changed | xargs cleartool co -nc
- cat changed | xargs cleartool ci -c 'some words...'
- rm **/*.keep
- git checkout .
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:
- I really do not know how to use clearcase
- Clearcase really sucks!
Does somebody knows how to quickly checkout then checkin modified hijacked files with Clearcase not UCM version ?
Edit:
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
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.
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...
Also I can set my matching files pattern using .gitignore
Perhaps others already made such scripts...