Base ClearCase FAQ 1.3.6: How to use annotate to produce a greppable output?

Solution

At least temporary... on an example:

$ CLEARCASE_TAB_SIZE=2 ct annotate -out - -nhe -fmt "%Sd %25.-25Vn %-8.8u,|,%Sd %25.-25Vn %-8.8u" -rm -rmf " D " single_build_engine.pl | grep unmv
08-Mar-05                   /main/1 vobadm16 D my $daily_build_home   = "/home/unmvbadm/RANOS_autobuild";
23-Jun-06 main/wendy_test/wran_r5/2 eeivob05 D my $daily_build_home   = "/home/unmvbadm/RANOS_autobuild/r5";
23-Aug-07 dy_test/wran_r5/wran_r6/1 eeivob05   my $daily_build_home   = "/home/unmvbadm/RANOS_autobuild/r6";
08-Mar-05                   /main/1 vobadm16     $label_owner = "unmvbadm";
08-Mar-05                   /main/1 vobadm16     if ($label_owner eq "unmvbadm") {

Problem

  • Get a greppable output—annotate is in general too verbose to be useful otherwise:
    • This implies that you don't want to 'elide' prefixes from any line
    • Get rid of headers
  • Align the content on the same column, after a prefix:
    • Set fixed size formats, relatively short
    • Set them wide enough to be useful, and truncate the versions from the left (align to the right)
    • Use a short tab size (2)
    • Use a short format to indicate deletions: ' D '

Notes

  • You may need the -nco option in addition
  • You may use -a instead of -rm. This will show versions 'outside the line of descent', but which may be interesting, e.g. if one has merged from them (which would otherwise be ignored...). Note that the -rmf option affects the 'UNRELATED' reports as well as the 'DEL' ones.

-- MarcGirod - 22 Aug 2008



EditAttachPrint versionHistory: r2 < r1BacklinksRaw ViewRaw editMore topic actions