[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: Re: Commit log templates

From: <Chris.Fouts_at_qimonda.com>
Date: 2006-08-28 16:46:10 CEST

Bart, we're trying something similar, but using Perl scripts
that has a "built-in" template. However, users will have to
use the Perl scripts. Your way however, seems to be more
generic so I'd like to pursue it. Some questions though...

- I assume I'll have a script, say svnlog.sh, that contains
  the code you provided correct? This will reside on the
  server side or client side?
- Will I have to set my SVN_EDITOR to this script, ie,
  setenv SVN_EDITOR svnlog.sh?
- In your pre-commit, is /project-foo/ just a stand-in
  for a real project, so one can use say $project for it?


>-----Original Message-----
>From: Bart Robinson [mailto:lomew@pobox.com]
>Sent: Friday, August 25, 2006 7:48 PM
>To: Garrett Rooney
>Cc: Irvine, Chuck R [LTD]; users@subversion.tigris.org
>Subject: Re: Commit log templates
>On 2006-8-14 Garrett Rooney <rooneg@electricjellyfish.net> wrote:
> > On 8/14/06, Irvine, Chuck R [LTD] <Chuck.R.Irvine@embarq.com> wrote:
> > > We consider the ability to have commit log templates
>(something similar > > to the CVS rcsinfo mechanism) a
>requirement really. I searched the > > mailing list archives
>and found that there was past discussion on adding > > this
>functionality and what the design would look like. Is this >
>> functionality in the latest version of subversion or is it
>targeted to > > an upcoming release? Thanks -Chuck > >
>There are various people who have talked about working on it,
>but > AFAIK nobody is currently working on it.
>A workaround is to make use of the SVN_EDITOR env var. This
>would of course require client-side configuration (at this
>point providing a custom built svn with your log message
>hardcoded is also an option).
>Here is an SVN_EDITOR script for Unix-like environments that
>might work for you:
># Example SVN_EDITOR script
>[ $# -eq 1 ] || {
> echo "usage: $0 file"
> exit 1
>[ -z $ed ] && ed=$EDITOR
>[ -z $ed ] && ed=vi
>cat <<ENDTEMPLATE >$file.$$
>cat $file >> $file.$$
>sum=`cksum $file.$$`
>if $ed $file.$$; then
> newsum=`cksum $file.$$`
> if [ "$newsum" != "$sum" ]; then
> rm -f $file
> mv $file.$$ $file
> else
> # no changes
> rm -f $file.$$
> fi
> echo "editor \"$ed\" failed"
> exit 1
>You could then check the format of log messages in the
>pre-commit hook, and if they are wrong the stderr can instruct
>them how to properly configure their client, e.g.:
>------ in pre-commit ------------------------------------------------
># Make sure they used the template
>if $SVNLOOK dirs-changed -t "$TXN" "$REPOS" | grep /project-foo/; then
> $SVNLOOK log -t "$TXN" "$REPOS" | grep "^BugId:" > /dev/null || {
> echo "*** Please configure your client to use the log
>message template" >&2
> echo "*** Instructions are here: http://foo" >&2
> exit 1
> }
>-- bart
>To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
>For additional commands, e-mail: users-help@subversion.tigris.org

To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Aug 28 17:06:58 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.