]> mj.ucw.cz Git - libucw.git/blobdiff - build/cvslog
conf2: polished error messages of commit-hooks
[libucw.git] / build / cvslog
index feded092f6648ced262db32f9d87a38bd0b3dbc7..cd7615cc33d7b045afabf36461fff48e865a9a92 100755 (executable)
@@ -1,13 +1,29 @@
 #!/usr/bin/perl
 # Process `cvs log' output to get a resonable changelog
-# (c) 2003 Martin Mares <mj@ucw.cz>
+# (c) 2003--2004 Martin Mares <mj@ucw.cz>
 
 use Digest::MD5;
 use POSIX;
 
+my %names= (
+       'mj'            => 'Martin Mares <mj@ucw.cz>',
+       'robert'        => 'Robert Spalek <robert@ucw.cz>',
+       'tom'           => 'Tomas Valla <tom@ucw.cz>',
+       'valla'         => 'Tomas Valla <tom@ucw.cz>',
+       'milan'         => 'Milan Vancura <milan@ucw.cz>',
+       'milanek'       => 'Milan Vancura <milan@ucw.cz>',
+       'tomhol'        => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
+       'centrum'       => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
+       'root'          => 'Tomas Holusa <tomas.holusa@netcentrum.cz>',
+       'pavel'         => 'Pavel Machek <pavel@ucw.cz>',
+       'th2'           => 'Tomas Holenda <tomas.holenda@netcentrum.cz>',
+       'croniak'       => 'Vladimir Jelen <vladimir.jelen@netcentrum.cz>',
+);
+
 while (<STDIN>) {
        chomp;
        /^$/ && next;
+       /^[?]/ && next;
        /^RCS file: / || die;
        $_ = <STDIN>;
        chomp;
@@ -22,27 +38,33 @@ while (<STDIN>) {
                if (/^------/) { $_ = <STDIN>; next; }
                /^revision / || die;
                $_ = <STDIN>;
+               my ($author) = /;\s*author:\s*([^;]+)/ or die;
                my ($yy,$mm,$dd,$HH,$MM,$SS) = /^date: (....)\/(..)\/(..) (..):(..):(..);/ or die;
                my $t = POSIX::mktime($SS,$MM,$HH,$dd,$mm-1,$yy-1900) or die;
                my $T = sprintf("%06d", int(($t + 1800)/3600));
                $d = "";
                while ($_ = <STDIN>) {
                        /^(-----|=====)/ && last;
-                       $d .= $_;
+                       $d .= "  $_";
                }
                my $id = "$T:" . Digest::MD5::md5_hex($d);
                if (!defined $msg{$id}) {
                        $date{$id} = "$yy-$mm-$dd $HH:$MM:$SS";
                        $msg{$id} = $d;
                        $files{$id} = "";
+                       $author{$id} = $author;
                }
-               $files{$id} .= "\t* $file\n";
+               $files{$id} .= "  * $file\n";
                #print "\t$id\n";
        }
 }
 
 foreach $id (sort keys %date) {
-       print "### ", $date{$id}, "\n\n";
+       if (!exists ($names{$author{$id}})) {
+               print STDERR "Unknown commiter $author{$id}\n";
+               $names{$author{$id}} = "unknown $author{$id}";
+       }
+       print "### ", $date{$id}, "  ", $names{$author{$id}}, "\n\n";
        print $files{$id}, "\n";
        print $msg{$id}, "\n";
 }