Subject: Re: Changelog -> mailinglist?
To: Jason Thorpe <thorpej@nas.nasa.gov>
From: Johan Danielsson <joda@pdc.kth.se>
List: current-users
Date: 07/21/1997 09:36:52
--Multipart_Mon_Jul_21_09:36:45_1997-1
Content-Type: text/plain; charset=US-ASCII

Jason Thorpe <thorpej@nas.nasa.gov> writes:

> Quite literally:
> 
> #!/bin/sh -e
> #       $Id: rotate,v 1.6 1996/01/03 19:22:26 mycroft Exp $
> [ -e commits.old ] || (
>         [ -s commits ] || exit
>         mv commits commits.old
>         sleep 1
> )
> mail -s 'NetBSD master CVS tree commits' source-changes < commits.old
> rm -f commits.old
> 
> ...by default, all commits are logged like:
> 
> umask 002; (echo ""; echo $USER; date; cat) >> $CVSROOT/CVSROOT/commits

Then what I want is something like:


--Multipart_Mon_Jul_21_09:36:45_1997-1
Content-Type: text/plain; charset=US-ASCII

sed -n -e 's,^Update of .*/cvsroot/,,p' | awk -F/ 'BEGIN{ n = -1 } { 
	if(n == -1)
		n = split($0, x, "/"); 
	else { 
		if(n > NF) 
			n = NF; 
		for(i = 1; i <= n; i++) 
			if(x[i] != $i) { 
				n = i-1; 
				break 
			} 
		} 
	}
	END { for(i = 1; i <= n; i++) printf(x[i] "/"); print "" }' 


--Multipart_Mon_Jul_21_09:36:45_1997-1
Content-Type: text/plain; charset=US-ASCII


Of the 247 mails I have since July 13, 5 had totally different paths,
194 had 3 or more components in common.

/Johan

--Multipart_Mon_Jul_21_09:36:45_1997-1--