Just be in the root of the directory tree you care about, and run the script, just like you would cvs stat (easier if it's in your path, but not essential).
Advanced niceness includes ansi colorisation and convenient alignment.
> 80 columns recommended :)
Term::ANSIColor required
#!/usr/bin/perl =head1 NAME cvs_stat - get summarised cvs status ignoring files that are up to dat +e =head1 CAVEATS There is probably a useful cpan cvs module this should use. =cut use strict; use Term::ANSIColor qw/colored/; open FH, 'cvs stat 2>&1 |'; my $dir; while (<FH>) { chomp $_; if (/^\? (.*)$/) { printf( '%27s: %s'."\n", '?', $1); next; } if (/^cvs (?:server|status): Examining (.*)$/) { $dir = $1; } if (/^File: (.*[^ ])\s+Status: (.*)$/) { my $file = $1; my $status = $2; $status eq 'Up-to-date' and next; my $padding = ' ' x (27 - length $status); my $file = ": $dir/$file"; if ( $status eq 'Locally Modified' ) { $status = colored($status, 'bold blue'); } elsif ( $status eq 'Needs Merge' ) { $status = colored($status, 'bold red'); } print $padding, $status, $file, "\n";; next; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: cvs_stat
by hossman (Prior) on Jan 11, 2005 at 19:22 UTC | |
by aufflick (Deacon) on Jan 12, 2005 at 23:28 UTC | |
|
Re: cvs_stat
by Tanktalus (Canon) on Jan 22, 2005 at 22:07 UTC | |
by aufflick (Deacon) on Jan 24, 2005 at 04:02 UTC | |
by Tanktalus (Canon) on Jan 24, 2005 at 04:46 UTC |