Suppose I've checked-out a file foo on a ClearCase view, which triggered the creating of a version of that file with branch name my_branch - the first version for that file with that branch name. Now I've un-checked-out the file - but version-0 of it with that branch name remains. How can I remove it? I know there's some way to do it using a "trigger" (I'm not quite familiar with those); can I just remove it manually with some command?
Note: my_branch has versions of other files on it; it shouldn't be removed entirely.
Manual removal of a single version-0 file
For a single file, as requested in the OP:
The (dangerous) command would be
cleartool rmverThat would be the manual approach, assuming
my_branchis created frommain.As illustrated here, in order for the version to not leave any dangling element (branch, label, hyperlink or attribute metadata), you would need:
(assuming the version 0 is the only version on that branch)
Manual removal of all files on a branch
As I mentioned in "how to remove a version in ClearCase", if you have inadvertently created some version-0's on a branch, the better way to remove them - all of them - is to use
cleartool rmbranch:You can see it used in "Command to delete branches of Clearcase element with “0” versions".
But that would be for the all branch indeed. Not for a single file.
Automatic removal
The automatic approach is put in place through a mktrtype, as I documented here.
As a script, you can use:
cc/triggers/RemoveEmptyBranch.plorclearcase/triggers/RemoveEmptyBranch.plThat does use a trigger: I mention it here just for the sake of completeness, even though it is not your preferred approach.
For a occasional cleanup,
rmveris enough for a lone 0 version.(for any other case, as discussed here,
rmveris dangerous)