[cvsnt] Change commit message

Ene Stelian-Bogdan-B11248 Stelian.Ene at freescale.com
Wed Jun 10 20:35:18 BST 2009


Community technical support mailing list was retired 2010 and replaced with a professional technical support team. For assistance please contact: Pre-sales Technical support via email to sales@march-hare.com.


Indeed, the solution was a hook in verifymsg, but I'm not sure if in
cvsnt's implementation write access is allowed to the log file -  a
search in this mailing list suggests it's not, and there is no
RereadLogAfterVerify parameter.

The script is reproduced bellow.


#!/bin/bash
# Bash-specific syntax is used
#
# This script will append the real name of the user doing the commit to
the message
# To enable, add the following line to REPO/CVSROOT/verifymsg :
#  DEFAULT  /full/path/to/this/script
# Make sure you have this enabled (default) in REPO/CVSROOT/config :
#  RereadLogAfterVerify=always
# (This command, and editting the cvs commit log, are not supported on
cvsnt)
#
# Comments:
#  stelian.ene[a]freescale.com


# Get the real name of the user
NAME=$(finger ${USER} | awk  '{for (i=7;i<NF;i++) print $i " "; print
$NF; exit;}')
MSGFILE="$1"

# Check the name lenth, allow for chinese people
if [ ${#NAME} -gt 3 ] && [ ${#NAME} -lt 50 ]; then
	# if we have a valid file to write into
	if [ -f $MSGFILE ]; then
		# append the real name to the commit message
		echo -n [$NAME] >> $MSGFILE
	fi
fi
		
# allways return 0, never cancel commits because of this silly script
exit 0 



-----Original Message-----
From: cvsnt-bounces at cvsnt.org [mailto:cvsnt-bounces at cvsnt.org] On Behalf
Of pdfeeny at aep.com
Sent: Wednesday, June 10, 2009 3:13 PM
To: Ene Stelian-Bogdan-B11248
Cc: cvsnt-bounces at cvsnt.org; cvsnt at cvsnt.org cvsnt downloads at march-hare.com @CVSNT on Twitter CVSNT on Facebook
Subject: Re: [cvsnt] Change commit message

cvsnt-bounces at cvsnt.org wrote on 06/10/2009 07:34:12 AM:

> Hello,
> 
> I need to perform a relatively simple task:
> Whenever a user commits with a certain "message", the commit message
> should be changed to:
> "[Real name] message"
> 
> The user's real name can be found in the passwd file or by executing
the
> finger command. 
> However, I don't know how to hook the commit action and actually
modify
> the message - I can only get a read-only access to the field.
> 
> Any ideas ?

You could write a script that runs on commit.  It should be fairly
simple 
to grab the commit message and prepend the user's id.  Use your favorite

scripting language and reference it in verifymsg like this:

DEFAULT /path/to/cvsnt/scripts/scriptname

or the Windows equivalent.  Search google for verifymsg script for 
information and ideas.  But if all you want is to see occasionally who 
committed what when, I would use the cvs history command. 


> Thank you
> _______________________________________________
> cvsnt mailing list
> cvsnt at cvsnt.org cvsnt downloads at march-hare.com @CVSNT on Twitter CVSNT on Facebook
> http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt https://www.march-hare.com/cvspro/en.asp#downcvs
> 
> Upgrade to CVS Suite for more features and support: http://march-
> hare.com/cvsnt/



Paul D. Feeny, MCP, MCSA
IT System Administrator II - SCM
IT Production Management
American Electric Power 
Phone: 614.716.2249
Audinet: 200.2249
_______________________________________________
cvsnt mailing list
cvsnt at cvsnt.org cvsnt downloads at march-hare.com @CVSNT on Twitter CVSNT on Facebook
http://www.cvsnt.org/cgi-bin/mailman/listinfo/cvsnt https://www.march-hare.com/cvspro/en.asp#downcvs

Upgrade to CVS Suite for more features and support:
http://march-hare.com/cvsnt/


More information about the cvsnt mailing list
Download the latest CVSNT, TortosieCVS, WinCVS etc. for Windows 8 etc.
@CVSNT on Twitter   CVSNT on Facebook