From owner-freebsd-hackers@FreeBSD.ORG Mon Aug 11 00:11:30 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 931) id B999237B401; Mon, 11 Aug 2003 00:11:30 -0700 (PDT) Date: Mon, 11 Aug 2003 02:11:30 -0500 From: Juli Mallett To: freebsd-hackers@freebsd.org Message-ID: <20030811021130.A31451@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i X-Title: Code Maven X-Towel: Yes X-Negacore: Yes X-Authentication-Warning: localhost: juli pwned teh intarweb Subject: Stupid CVS tricks. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Aug 2003 07:11:31 -0000 Below you'll find some over-mutilated Perl I did just now to produce dot (as in, graphviz) format graphs for CVS logs, with a link from each committer to each RCS file for every commit. With relatively small data sets (fcvs-src rlog xargs, or kern_sig.c,v) this will produce fairly interesting and meaningful figures. Looking at these things, I get a fairly good feel for certain things, and you certainly can notice a lot of patterns. Things aren't spaced out and evened out quite as much as I'd like, but I have roughly zero cool on how to do that without linking all the files to eachother, and the same of all committers. %%% #! /usr/bin/env perl # # CVS logs to dot format. $curfileno = 0; $cvslog = "cvs-log"; open(DATA, "<$cvslog") || die "$!"; print "digraph cvs {\n"; while () { while (!/^RCS file:/) { $_ = ; } if (/^date: /) { $author = "$_"; $author =~ s/date: .* author: (.*) state: .*/$1/i; $author =~ s/\;//g; chomp $author; if ($committers{"$author"} != 1) { print "z" . $author . " [shape=rectangle,label=\"" . $author . "\"];\n"; $committers{"$author"} = 1; } print "z" . $author . " -> " . "z" . $curfileno . ";\n"; } if (/^RCS file:/) { $curfileno++; $curfile = "$_"; $curfile =~ s/RCS file: //; chomp $curfile; print "z" . $curfileno . " [shape=hexagon,label=\"" . $curfile . "\"];\n"; } } print "};\n"; close(DATA); %%% Name it something like cvsdot.pl and invoke it like: fcvs-src rlog src/sys/kern/kern_sig.c > cvs-log perl cvsdot.pl | dot -Tpng > _.png [view] _.png Actually, kern_sig.c is a terrible idea, but there you go. Thought some of you hackers might find this interesting! Thanx, juli. -- juli mallett. email: jmallett@freebsd.org; efnet: juli; aim: bsdflata; i have lost my way home early - i don't care cause i won't stay there.