How do I list the description of a clearcase file?

58 Views Asked by At

I know that I can list all files I have on the "MyBranchName" with the following command:

cleartool find . -cview -type f -branch 'brtype(MyBranchName)' -print

But I need to know the description / (or comment if you want) of the files which you can set when you do checking-out or checking-in . Is there a way to do that too ?

I already searched for the internet after a solution, but couldn't find it. I start to think that it isn't even possible.

2

There are 2 best solutions below

0
VonC On BEST ANSWER

The cleartool describe command should be involved here.

With Linux (or Windows Git bash shell), you might consider:

cleartool find . -cview -type f -branch 'brtype(MyBranchName)' -print | \
   xargs -I {} cleartool describe -fmt "%n: %c\n" {}

But using cleatool find -exec should be more efficient:

I mentioned before:

cleartool find -avobs -branch (brtype<BRANCH>) -version "lbtype(<LABEL>)" -exec "cleartool describe -fmt \"%Xn : %u\n\" \"%CLEARCASE_XPN%\""

In your case:

cleartool find -cview -branch 'brtype(MyBranchName)' -exec "cleartool describe -fmt \"%n : %c\n\" \"%CLEARCASE_XPN%\"

Linux syntax:

cleartool find -cview -branch "brtype(MyBranchName)" -exec 'cleartool describe -fmt "%n : %c\n" "$CLEARCASE_XPN"'
2
Brian Cowan On

@VonC The output of that command will be: m:\myview\myvob\dir1\myfile.txt@@\main\branch {comment on BRANCH creation}

Use -version instead, and consider using -all. For example, though I didn't include -type f so you see more than one line of output and also see comments (most of my test checkins are -nc...):

cleartool find -all -version "brtype(p50-branch)" -exec 'cleartool desc -fmt "%n : %c\n" $CLEARCASE_XPN'
/view/ncaexported/vobs/bc-linuxtest/test1@@/main/p50-branch/0 : 
/view/ncaexported/vobs/bc-linuxtest/test1@@/main/p50-branch/1 : Added file element "testthis.txt".

/view/ncaexported/vobs/bc-linuxtest/test1/temp1.txt@@/main/p50-branch/0 : 
/view/ncaexported/vobs/bc-linuxtest/test1@@/main/p50-branch/1/testthis.txt@@/main/p50-branch/0 : 
/view/ncaexported/vobs/bc-linuxtest/test1@@/main/p50-branch/1/testthis.txt@@/main/p50-branch/1 :