The current RCS template contains:

PR:
Submitted by:
Reviewed by:
Obtained from:

It's unnecessary to print one of those extra RCS template fields in
the commit log if it's been left empty.

Adding the attached script (procured from the FreeBSD project) to
CVSROOT/ will strip the empty RCS lines from the final commit log.

The following change is also required to CVSROOT/verifymsg:

Index: verifymsg
===================================================================
RCS file: /repository/CVSROOT/verifymsg,v
retrieving revision 1.1
diff -u -r1.1 verifymsg
--- verifymsg   1999/05/24 04:43:27     1.1
+++ verifymsg   2001/03/29 16:12:30
@@ -19,3 +19,5 @@
 # One thing that should be noted is the the ALL keyword is not
 # supported.  There can be only one entry that matches a given
 # repository.
+
+DEFAULT               $CVSROOT/CVSROOT/logcheck

I don't have access to commit to the CVSROOT/ directory, so someone
with the proper karma will have to review these changes and make the
decision to commit them.

-- 
Jon Parise ([EMAIL PROTECTED])  .  Rochester Inst. of Technology
http://www.csh.rit.edu/~jon/  :  Computer Science House Member
#! /usr/bin/perl -w
#
# $FreeBSD: /c/ncvs/CVSROOT/logcheck,v 1.6 2000/02/13 04:04:29 peter Exp $
# 
# This hack is to sanitise the results of what the user may have
# "done" while editing the commit log message.. :-)   Peter Wemm.
#
# Note: this uses an enhancement to cvs's verifymsg functionality.
# Normally, the check is advisory only, the FreeBSD version reads
# back the file after the verifymsg file so that this script can
# can make changes.
#

if (!@ARGV) {
        die "Usage: logcheck filename\n";
}
$filename = $ARGV[0];
$tmpfile = $filename . "tmp";

open(IN, "< $filename") ||
        die "logcheck: Cannot open for reading: $filename: $!\n";

open(OUT, "> $tmpfile") ||
        die "logcheck: Cannot open for writing: $tmpfile: $!\n";

# In-place edit the result of the user's edit on the file.
$blank = 0;     # true if the last line was blank
$first = 0;     # true if we have seen the first real text
while(<IN>) {

        # Dont let CVS: lines upset things, strip them out.
        if (/^CVS:/) {
                next;
        }

        chop;           # strip trailing newline
        s/[\s]+$//;     # strip trailing whitespace

        # collapse multiple blank lines, and trailing blank lines.
        if (/^$/) {
                # Blank line. Remember in case more text follows.
                $blank = 1;
                next;
        } else {
                # Delete if they only have whitespace after them.
                if (/^Reviewed by:$/i ||
                    /^Submitted by:$/i ||
                    /^Obtained from:$/i ||
                    /^PR:$/i) {
                        next;
                }
                if ($blank && $first) {
                        # Previous line(s) was blank, this isn't. Close the
                        # collapsed section.
                        print OUT "\n";
                }
                $blank = 0;     # record non-blank
                $first = 1;     # record first line
                print OUT "$_\n";
        }
}
close(IN);
close(OUT);

unlink($filename . "~");        # Nuke likely editor backups..
unlink($filename . ".bak");     # Nuke likely editor backups..

rename("$tmpfile", "$filename") ||
        die("logcheck: Could not rename $tmpfile to $filename: $!");

exit(0);


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to