How to list all my check-ins using ClearCase?
Asked Answered
N

3

18

Is it possible to get a list of all the check-ins I've made within a given source code directory tree using cleartool? If possible I'd like to see when the check-in was made and the file version. I'm using Windows.

Thanks in advance.

Natalya answered 22/2, 2009 at 11:8 Comment(0)
G
19

This would involved a cleartool find command with:

  • an -exec directive to describe the versions found
  • a -fmt to better format the result
  • a -created_by query language operator to restrict the results to only your checkins versions.

You can either display all versions of the checkins files, or only one file per all versions checked-in, that is the 'element'. In your case, to see when the checkin has been made, you need to list the versions.

Something like:

REM Windows syntax
cleartool find . -ver "created_by(myLogin)" -exec "cleartool descr -fmt \"%En : %Sn made %Vd\n\" \"%CLEARCASE_XPN%\""

# Linux syntax
cleartool find . -ver 'created_by(myLogin)' -exec 'cleartool descr -fmt "%En : %Sn made %Vd\n" "$CLEARCASE_XPN"'

'.' will designate the current directory from which you are looking your versions.

%Sn will give you branch/versionNumber, %Ln would only give you the version number.

Gaddy answered 22/2, 2009 at 13:10 Comment(7)
@AmitP well yes... cc is very lame and ugly. it's obvious to use git only. i don't know how my coworkers were treated by this ugly stuff for years...Julianjuliana
@Gaddy I am getting - Unmatched ". error when I run the above command. Do you have any suggestion?Amir
@Amir What command did you type? With which version of ClearCase? On which OS? In a dynamic or snapshot view?Gaddy
@Gaddy I typed the same command in your answer replacing myLogin with my username. I use HCL ClearCase 9.0.1.2 x86_64 GNU/Linux and its a dynamic viewAmir
@Amir You have copied a command using the Windows syntax. I have edited the answer to include the same command in the Linux syntax: give it a try.Gaddy
@Gaddy thanks it works but I see some error message in the output: cleartool: Error: Unable to access "./Makefile@@/main/Main_proj_int/sub_proj_int/user_view/0%": No such file or directory. cleartool: Error: Unable to access "./Makefile@@/main/Main_proj_int/sub_proj_int/user_view/1%": No such file or directory.Amir
@Amir Sorry, the final % should not have been there. I have edited the answer to fix the command.Gaddy
B
11

I know the original question was about cleartool, but lots of people don't realize you can also do this with the ClearCase ReportBuilder GUI. The advantage of using the GUI (other than not having to learn the syntax of cleartool find), is in the result you can right-click the selected elements and immediately popup a "compare with previous version" or version tree. It depends on what you want to do with the output.

The ReportBuilder is found under the "Administration" folder (All Programs > IBM Rational ClearCase XXX > Administration > ReportBuilder). You may not have noticed it because it's tucked away under "Administration" but it's not just for administrators - there are many useful queries for anybody using ClearCase.

Under the Report Builder, go to Elements > Checkins Since Date by User and select the directories to report on, date since, and your user ID, then click "Run Report".

Bougainville answered 15/8, 2013 at 10:31 Comment(0)
V
0

I used this command (in a DOS shell, not Cygwin) to (1) ignore directories, and (2) get check-in comments in addition:

cleartool find . -ver "eltype(text_file) && created_by(your_login)" -exec "cleartool descr -fmt \"%n: %c\n\n--\n\n\" \"%CLEARCASE_XPN%\"" >> checkins.txt
Vallie answered 21/12, 2011 at 22:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.