[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Trigger not working
From: |
Mark D. Baushke |
Subject: |
Re: Trigger not working |
Date: |
Mon, 12 Dec 2005 11:43:03 -0800 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
akkisoft <address@hidden> writes:
> I am following the steps mentioned below to apply trigger on commit in
> CVS.
>
> Create a template file '/usr/cvssupport/tc.template'.
> BugId:
>
> The script '/usr/cvssupport/bugid.verify' is used to evaluate the log
> message.
> #!/bin/sh
> #
> # bugid.verify filename
> #
> # Verify that the log message contains a valid bugid
> # on the first line.
> #
> if sed 1q < $1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
> exit 0
> elif sed 1q < $1 | grep '^BugId:[ ]*none$' > /dev/null; then
> # It is okay to allow commits with 'BugId: none',
> # but do not put that text into the real log message.
> grep -v '^BugId:[ ]*none$' > $1.rewrite
The above line will want to have $1 other wise grep will be trying to
read from stdin. So, something like this
grep -v '^BugId:[ ]*none$' $1 > $1.rewrite
is probably desirable to be added.
> mv $1.rewrite $1
> exit 0
> else
> echo "No BugId found."
> exit 1
> fi
Be advised that verifymsg is run for each directory during a commit, so
a multi-directory commit with 'BugId: none' should find that the BugId
line has been removed and fail.
>
> The 'verifymsg' file contains this line:
> ^tc /usr/cvssupport/bugid.verify
Note that if you are using cvs 1.12.x, you may want to add the %l
argument to the end of the above line ad nthe 'UseNewInfoFmtStrings=yes'
to the CVSROOT/config file.
>
> The 'rcsinfo' file contains this line:
> ^tc /usr/cvssupport/tc.template
>
> The 'config' file contains this line:
> RereadLogAfterVerify=always
>
>
> Even after completing all the steps I can commit a file with no/any
> message. As mentioned in the template file the message should start
> with "BugId:"
> Is there anything I am doing wrong?
To debug this, you probably want to use 'cvs -t commit' or if you are
using cvs 1.12.x you may want 'cvs -t -t -t commit' to see how the
trigger script are being run, or if they are being run. It may be that
the ^tc line is not matching the file you are committing.
>
> Just FYI, I also have a trigger on my module (Project1) which sends a
> mail if there is any commit.
> ^Project1* mail -s Checked\ In:\ %s\ User:\ $USER cvsuser
> DEFAULT (echo ""; id; echo %{sVv}; date; cat) >>
> $CVSROOT/CVSROOT/commitlog
> These lines are added in loginfo and works fine.
>
> Akki
-- Mark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
iD8DBQFDndLGCg7APGsDnFERAgYKAJ4krc+9teZ5Hh6N/SpEPCSQvRADWQCfd3iy
/qlYeI13EU+7YUIaHLk3rSs=
=WTTZ
-----END PGP SIGNATURE-----