2010-01-08

Bash code: CVS status logging

This command has the effect of checking each of the indicated files in the source tree against the CVS repository - errors should be propagated to stderr if a file in the source tree does not exist in the CVS repository - this cmd should be refined into a script which tests for error on status and tries to add source files which do not appear to be in the repository....

for fn in *.{css,js,html,php} ./xml/*.xml ./xml/services/*.xml ./js/*.js ; 
    do echo $fn ; 
    cvs status $fn; 
    echo ""; done > cvs-status.txt

Note that the command cvs status [in src dir, w/ no args] does something similar to the above command, differing in that using cvs status may not handle the cases a source file exists which has not been added to the repository.

The CVS manpage does not address this:

       status [-lRqQ] [-v] [files...]
              Requires: working directory, repository.
              Changes: nothing.
              Display a brief report on  the  current  status  of  files  with
              respect to the source repository, including any ``sticky'' tags,
              dates, or -k options.  (``Sticky''  options  will  restrict  how
              `cvs  update' operates until you reset them; see the description
              of `cvs update -A...'.)

              You can also use this command to anticipate the potential impact
              of  a  `cvs update' on your working source directory.  If you do
              not specify any files explicitly,  reports  are  shown  for  all
              files  that  cvs  has placed in your working directory.  You can
              limit the scope of this search to the current  directory  itself
              (not  its  subdirectories)  with the standard -l option flag; or
              you can explicitly request recursive status reports with the  -R
              option.

              The  -v  option  causes the symbolic tags for the RCS file to be
              displayed as well.