[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with regexp in commitinfo

From: Larry Jones
Subject: Re: Problems with regexp in commitinfo
Date: Tue, 14 Jan 2003 15:00:50 -0500 (EST)

George writes:
> I want a commit in any file in the "testapp" module under $CVSROOT to
> trigger my script.  So I set up commitinfo as follows:
> testapp $CVSROOT/CVSROOT/commitcheck
> The problem is that not only do commits in files in $CVSROOT/testapp
> trigger the script, but all files with the word "testapp" anywhere in
> the path seem to trigger the script.  For example, a commit of
> "$CVSROOT/someotherproject/testapp/somefile.txt" also triggers the
> script.

That's correct -- the regular expressions are not anchored, so they'll
match anywhere in the path unless you anchor them yourself.

> Is there a more proper way to code the commitinfo file?  I tried this
> with the same results:
> ^testapp $CVSROOT/CVSROOT/commitcheck

Now you've anchored the beginning (but not the end), so you will only
match paths that *start* with testapp.  If you got the same results as
before, you must not have committed the change.  The only remaining
problem is that that pattern will match files and directories that start
with testapp rather than just exactly testapp.  That may not be a
problem, but if it is, you just need to add the trailing slash:

        ^testapp/ $CVSROOT/CVSROOT/commitcheck

-Larry Jones

Something COULD happen today.  And if anything DOES,
by golly, I'm going to be ready for it! -- Calvin

reply via email to

[Prev in Thread] Current Thread [Next in Thread]