summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cvs/contrib/checklog.pl
blob: fab1c8f5d61fd21a702d576206da98fec95a9cef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/perl
# Copyright (c) Wolfram Schneider <wosch@freebsd.org>. June 1996, Berlin.
#
# checklog - extract your commits from commitlogs archive
#
# checklog username /a/cvs/CVSROOT/commitlogs/*[a-y]
# zcat /a/cvs/CVSROOT/commitlogs/*.gz | checklog [username]
#
# $Id: checklog.pl,v 1.2 1996/06/27 12:54:25 wosch Exp $

# your name or first argument
if ($ARGV[0]) {
    $name = $ARGV[0]; shift @ARGV; 
    warn "Is this really a username: `$name' ?\n" 
	unless $name =~ /^[a-z0-9]+$/;
} else {
    $name = `whoami`; chop $name;
}

# date string 96/02/18 10:44:59
$date = '[0-9][0-9]/[0-9][0-9]/[0-9][0-9] [0-9][0-9]:[0-9][0-9]:[0-9][0-9]';

$flag = 0;
while(<>) {
    if (/^[a-z]/) {		  # start of a commit
	if (m%^$name\s+$date$%o) { # it's  *your* commit
	    $flag = 1;
	} else {
	    $flag = 0;
	}
    }

    print if $flag;
}
OpenPOWER on IntegriCloud