tags:

views:

707

answers:

3

When doing a cvs update, you get a nice summary of the state of the repository, for example:

M src/file1.txt
M src/file2.txt
C src/file3.txt
A src/file4.txt
? src/file5.txt

Is there a way to get this without actually updating? I know there is cvs status, but this is way to verbose:

===================================================================
File: file6.txt        Status: Up-to-date

Working revision:    1.2
Repository revision: 1.2     /var/cvs/cvsroot/file6.txt,v
Sticky Tag:          (none)
Sticky Date:         (none)
Sticky Options:      (none)

I could of course make a script to do the transformation from the latter to the former, but it seems a waste of time since cvs can obviously produce the former.

+8  A: 

You can use the -n flag to get the update output without actually updating the files. You can also add -q (quiet) to suppress any server messages.

cvs -q -n update
jmcnamara
"cvs -n update" is a great solution for previewing a CVS update (thank you), but doesn't seem to work with tags. For example, "cvs -n update -dP -r DRUPAL-5-15" gives "cvs [update aborted]: no such tag `DRUPAL-5-13'", but the tag is definitely valid, as "cvs update -dP -r DRUPAL-5-15" works fine.
Philip Durbin
+1  A: 

@jmcnamara: Good tip!

And all this time I've been using this bash script:

cvs -q status "$@" | grep '^[?F]' | grep -v 'Up-to-date'
Pistos
+1  A: 

If you're using CVSNT you can also just do cvs status -q which will also produce much briefer output than the regular status command (also just one line per file). With more recent versions you can even do cvs status -qq which will skip the up-to-date files.

Oliver Giesen