Topic
  • 5 replies
  • Latest Post - ‏2004-07-22T18:16:08Z by SystemAdmin
SystemAdmin
SystemAdmin
47293 Posts

Pinned topic Finding a renamed file

‏2004-07-22T12:10:28Z |
What is the find command to search for a renamed file within a VOB? Thanks.
Updated on 2004-07-22T18:16:08Z at 2004-07-22T18:16:08Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    47293 Posts

    RE:Finding a renamed file

    ‏2004-07-22T13:59:31Z  
    >> What is the find command to search for a renamed file within a VOB?
    Thanks.

    a) There isn't one. The information you're asking for isn't tracked by
    ClearCase at the vob level.[1]

    a1) However, you could write a script to walk every directory
    version in the vob, print the OID+filename for each entry in each directory
    version, and then check the output for OIDs with multiple filenames.

    b) If the rename occured in the same directory element (i.e. 'ct mv
    ./foo.txt ./bar.txt'):

    b1) You can write a script to walk the directory versions and dump
    the filename + OID of each entry. Look for OIDs with multiple filenames. I
    vaguely remember posting such a script to CCIUG, so you might want to search
    the archives.

    b2) You can do a diff between directory versions to see what
    changed. You would still need to do a 'ct describe' to verify the OIDs were
    identical.

    b3) 'ct lshis -d dirname' might be useful for finding the renamed
    element.

    c) If the rename happened during a directory move (i.e. 'ct mv dir1/foo.txt
    dir2/bar.txt') then:

    c1) If you have two views, where one view has the orignal name, and
    the other has the new name, then a script can be written to do what you
    want. You would dump the OIDs+filename for each view and look for OIDs with
    different filenames between the views.

    c2) 'ct lshis -all' might be useful for finding the moved & renamed
    element. Especially if you can narrow it down by date and/or user.
    [1] Elements exist in a big pool. Elements have unique identifiers for
    names (called OIDs.) A directory version is simply a list of text strings
    (the filenames,) each filename points to an OID, and each OID points to the
    actual element. During a rename, ClearCase just tracks the filename change
    (via directory versioning) and does nothing to track the underlying OID.
    There is no built in query to match filenames against OIDs. You have to
    dump the filenames+OIDs yourself and crunch the data.

    <============================================================
    To unsubscribe, send email to
    majordomo@lists.us.ibm.com and put these words in the
    message body: unsubscribe cciug
    ============================================================>
  • SystemAdmin
    SystemAdmin
    47293 Posts

    RE:Finding a renamed file

    ‏2004-07-22T15:19:16Z  
    If you know where to access a version of the file with the old name (i.e., in a view with the config spec set to see the file) then run this command substituting <file> with the actual name or path to the file:

    cleartool desc -fmt "%O\\n" <file>

    This will display the object id of the file. In the new view where you want to know the new name run this command substituting <oid> with the object id given by the previous command:

    cleartool desc -fmt "%n\\n" <oid>

    For more information see:

    cleartool man desc
    cleartool man fmt_ccase
    Albin Gersich
    Electronic Design Systems (EDS)
    IDS Puget Sound IT
    The Boeing Company
    Office: 253-657-0422

    -----Original Message-----
    From: Rational ClearCase mailto:disadmin@us.ibm.com
    Sent: Thursday, July 22, 2004 5:10 AM
    To: cciug@lists.us.ibm.com
    Subject: cciug Finding a renamed file
    What is the find command to search for a renamed file within a VOB? Thanks. <============================================================
    To unsubscribe, send email to
    majordomo@lists.us.ibm.com and put these words in the
    message body: unsubscribe cciug ============================================================>

    <============================================================
    To unsubscribe, send email to
    majordomo@lists.us.ibm.com and put these words in the
    message body: unsubscribe cciug
    ============================================================>
  • SystemAdmin
    SystemAdmin
    47293 Posts

    RE:Finding a renamed file

    ‏2004-07-22T15:24:00Z  
    Correction, the second command should be:

    cleartool desc -fmt "%n\\n" oid:<oid>

    I forgot to include the oid: part.

    Albin Gersich
    Electronic Design Systems (EDS)
    IDS Puget Sound IT
    The Boeing Company
    Office: 253-657-0422

    -----Original Message-----
    From: Gersich, Albin G
    Sent: Thursday, July 22, 2004 8:19 AM
    To: cciug@lists.us.ibm.com
    Subject: RE: cciug Finding a renamed file
    If you know where to access a version of the file with the old name (i.e., in a view with the config spec set to see the file) then run this command substituting <file> with the actual name or path to the file:

    cleartool desc -fmt "%O\\n" <file>

    This will display the object id of the file. In the new view where you want to know the new name run this command substituting <oid> with the object id given by the previous command:

    cleartool desc -fmt "%n\\n" <oid>

    For more information see:

    cleartool man desc
    cleartool man fmt_ccase
    Albin Gersich
    Electronic Design Systems (EDS)
    IDS Puget Sound IT
    The Boeing Company
    Office: 253-657-0422

    -----Original Message-----
    From: Rational ClearCase mailto:disadmin@us.ibm.com
    Sent: Thursday, July 22, 2004 5:10 AM
    To: cciug@lists.us.ibm.com
    Subject: cciug Finding a renamed file
    What is the find command to search for a renamed file within a VOB? Thanks. <============================================================
    To unsubscribe, send email to
    majordomo@lists.us.ibm.com and put these words in the
    message body: unsubscribe cciug ============================================================>

    <============================================================
    To unsubscribe, send email to
    majordomo@lists.us.ibm.com and put these words in the
    message body: unsubscribe cciug ============================================================>

    <============================================================
    To unsubscribe, send email to
    majordomo@lists.us.ibm.com and put these words in the
    message body: unsubscribe cciug
    ============================================================>
  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: Finding a renamed file

    ‏2004-07-22T18:15:24Z  
    'cleartool find /somevob -all -nvisible -name 'filename' -print' will show you files not visible in your view.
  • SystemAdmin
    SystemAdmin
    47293 Posts

    Re: Finding a renamed file

    ‏2004-07-22T18:16:08Z  
    'cleartool find /somevob -all -nvisible -name 'filename' -print' will show you files not visible in your view.
    Oh wait, rename not rmname, nevermind.