· ClearCase is a program for software configuration management and version control of all types of files & directories (elements).
· It enables parallel development on geographically distributed sites.
· ClearCase runs in both Unix and Windows. There is two interfaces in UNIX, command line (CLI) and graphical (GUI).
· It enables access to files and directories as usual, but if you would like to change elements you must use ClearCase.
· The method to work with elements is check-out/edit/check-in.
· A VOB (Version Object Base) is a database (repository) that stores version-controlled elements, such as source files, binary files, directories etc.
· You must mount a VOB (make a connection) before accessing the elements in it.
· A VOB can be mounted on some or all workstations. A project can have more than one VOB.
· ClearCase protects files in the VOB from accidental modification, thereby all the elements is stored as read-only.
· Each VOB must have a descriptive name, called a VOB-tag. When accessing elements or working with VOBs, you use the VOB-tag. When listing VOBs you see the tag and the storage path like this:
VOB-tag Storage path
· A filter to access files in a VOB.
· You must set a view (make it active) before you can access files.
· You specify what you want to see in your view (which version of the file/directory), by the rules in your config spec.
· A view only shows one version of each file/directory.
· Each user may have multiple views. As for example, a view for new development, a view for bug fixing etc.
· There are two types of views:
· Dynamic views – displays versions held in the VOB. Provide immediate, transparent access to the data in the VOBs.
· Snapshot views – copies the elements to your local file system.
· Most common is dynamic views.
· Each view must have a descriptive name, called a view-tag. When working with views, you use the view-tag. When listing views you see the tag and the storage path like this:
View-tag Storage path
What is an element?
- An element is a file or directory placed under control with ClearCase.
- An element consists of a structure of organized versions, called a version tree.
- Elements can have any number of versions.
· A version tree is a representation of the different versions of a file or directory.
· A version tree can include multiple branches, of which each represents an independent line of development
Fig. Version tree
What is a branch?
· A new element will be placed on the “main” branch.
· New projects and when working with a bug fix, usually gets their own branch.
· The figure is showing a version tree of the file hello.c, with different branches.
Fig: Version tree with branches
· You label versions of special interest, for example versions that are a part of a release of your product.
· Labels are always written in uppercase.
Fig. Version tree with labels
What is a config spec (Configuration specification)?
· Rules that determines which version of the elements (folders, files) that are visible in a view.
· Each view has its own config spec.
Fig. The rules in the config spec decides which version of the elements, that will be shown in the view.
- A private file not made to an element, will only be visible in this view.
- A checked out file will become view-private.
- A file that exists only in a particular view. A private file is not version-controlled, except insofar as it is separate from private files in other views.
What is a checkout?
- To be able to edit elements (change a file or directory) you have to do a “checkout”.
- There are two types of checkouts:
- Reserved – A checkout is reserved as default. An element can only have one reserved checkout for the same branch at a time. Prevents checking in from other users.
- Unreserved - Can be done regardless other checkouts of the element. Many unreserved checkouts of an element can exist. Must be merged with the latest version before checking in, if there has been a former check-in of the element on the branch. See below.
- If you regret your checkout you can do an uncheckout. You will prompted to save your modification in a view-private file with a .keep extension.
· When you check-in a file or directory there will be a new version in the VOB.
- The editable version copy of the file is removed from your view.
· Combining contents of files or directories.
· The differences are pointed out and the user decides which changes to be done.
- The merge can be done from any branch to another.
Fig. Checking in / merging an unreserved checkout
The File Browser shows files and directories from a VOB. From here, you can checkout, check-in, display the version tree of files etc. Your views config spec decides what and which versions of the elements you see in the file browser.
Fig. File Browser
The Vtree Browser shows all the versions of an element. From here you can check-out, edit and check-in files. There are also options for comparing different versions of files with a “diff tool” and possibilities to merge files.
Fig. Vtree Browser
The History Browser describes the changes made to en element, like creating, checking-out etc.
Fig. History Browser