You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Brian Krusic <br...@krusic.com> on 2006/07/07 20:34:57 UTC

forcing log entry during commit

I would like to force users to write a log entry about the nature of the commit and have seen a hook script called enforcer that may help me do this.

Would some one mind getting me started on how to do this?

I imagine referancing some SVN variable to check if its not blank.

Perhaps the some thing that checks for a new line would do?

Re: forcing log entry during commit

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 7, 2006, at 22:34, Brian Krusic wrote:

> I would like to force users to write a log entry about the nature  
> of the commit and have seen a hook script called enforcer that may  
> help me do this.
>
> Would some one mind getting me started on how to do this?
>
> I imagine referancing some SVN variable to check if its not blank.
>
> Perhaps the some thing that checks for a new line would do?


We use this script. Call it "pre-commit", put it in your repository's  
hooks directory, and make sure it's readable and executable by Apache  
or svnserve or whatever's serving your repository:


#!/bin/sh

REPOS="$1"
TXN="$2"

# Make sure that the log message contains some text.
SVNLOOK=/usr/bin/svnlook
$SVNLOOK log -t "$TXN" "$REPOS" | grep "[a-zA-Z0-9]" > /dev/null

if [ $? != 0 ]; then
         echo "Please enter a commit message." 1>&2
         exit 1
fi

# All checks passed, so allow the commit.
exit 0


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

RE: forcing log entry during commit

Posted by Alexander Ogol <al...@ogol.info>.
Further enhance of this idea is to integrate SCM with Issue Tracker to be
able to track what checkin corresponds what task (issue).
Look at SCMBug http://www.mkgnu.net/?q=scmbug
They modify hooks for your project, so they restrict commit on different
rules (task ID is not present, comment is not present, corresponding task is
not in opened state, corresponding product is not opened, task is not
assigned to this commiter)


  _____  

From: Brian Krusic [mailto:brian@krusic.com] 
Sent: Friday, July 07, 2006 11:35 PM
To: users@subversion.tigris.org
Subject: forcing log entry during commit


I would like to force users to write a log entry about the nature of the
commit and have seen a hook script called enforcer that may help me do this.
 
Would some one mind getting me started on how to do this?
 
I imagine referancing some SVN variable to check if its not blank.
 
Perhaps the some thing that checks for a new line would do?