Posted by Neil Crosby on February 16, 2008 04:15 PM
cvs status 2>/dev/null | grep Status: | grep -v "to-date"
That’s what I use on the command line to see which files aren’t up to date within my CVS tree at work (at home I use SVN, which in my opinion is a lot nicer).
If you’re interested, here’s what each bit of that command does:
cvs statusjust does the normal CVS command to tell you the status of each file
2>/dev/nullpushes any “error” messages out to /dev/null so that you don’t see them. In this case, that includes things like telling you which directory you’re traversing into. For me, this is extraneous data that I don’t want, but your mileage may vary.
| grep Statuspipes the previous ouput through
grepand only leaves lines which contain the text “Status:”, so we’re only left with lines with status information on them.
| grep -v "to date"pipes the remaining output through
grep, inverts the way grep works (-v) and throws away any lines that say they’re up to date.
- So, we’re simply left with lines that contain status information but aren’t about files that are up to date. This can include files that need to be patched, merged or committed.
cvs -q status | grep ^[?F] | grep -v "to-date"
This does the same job in a few less bytes, and it shows up files which haven’t yet been added to the repository.
Mac users might also like to add the following to their
~/.cvsignore files to ignore those pesky files that OS X seems so intent on creating: