[Top][All Lists]

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

Re: Intelligent commit triggers

From: Dennis Jones
Subject: Re: Intelligent commit triggers
Date: Thu, 26 Jul 2007 16:58:11 GMT

"Todd Denniston" <address@hidden> wrote in message 
> Hans Schwaebli wrote, On 07/26/2007 09:00 AM:
>> In CruiseControl I can use something like this:
>>    <modificationset quietperiod="1" >
>>     <compound includeTriggerChanges="false">
>>         <triggers>
>>             <filesystem folder="./mod_file.txt" />
>>         </triggers>
>>         <targets>
>>             <cvs
>>                 cvsroot=":pserver:address@hidden:/cvs"
>>             />
>>         </targets>
>>     </compound>
>> </modificationset>
>>    Our CVS administrator managed to write a trigger which touches a file 
>> whenever something is comitted into the CVS repository.
>>    But this does not distinguish into which branch something is checked 
>> in.
>>    Since we have two branches, one for active development line and one 
>> for release line, and thus two builds, we need a trigger which 
>> distinguishes on which branch something is checked in.
>>    If something is checked into the active development line branch, then 
>> file A has to be touched, if something is checked into release line, file 
>> B has to be touched.
>>    This seems to be very basic needs, but also very in-depth knowledge of 
>> CVS and Linux batch scripting needed, which I don't have.

It's actually not all that hard to do (I should know, because I do it, and I 
know as little about Unix as possible!).  Here's how *I* do it:

1) Use loginfo to send commits to a formatting script (in my case, named

DEFAULT  /repository/utils/  $CVSROOT/commitlog  $USER  %{sv}

2) Use to format and send the formatted commit information to a 
log file:


cat > tmp
(echo "------------------------------------------------------------";
 echo -n $USER"  ";
 echo $REVINFO;
 cat tmp) >> $LOGFILE
cat tmp | /repository/utils/LogBranch $CVSROOT
rm tmp
chmod 666 $CVSROOT/

3) You will note that the script pipes its output through a program called, 
"LogBranch".  LogBranch is just a C program I wrote to parse the commit 
information and look for the text, "Tag:".  If it finds "Tag:", then the 
file was committed on a branch, and the branch name will follow "Tag:".  If 
there is no "Tag:" in the commit text, then the file was committed on the 
trunk.  In my case, LogBranch writes the branch names to another file 
called, ""  At the end of the day, all branches on which 
commits occured are listed in the file, and my nightly 
automated build process can iterate through the list and build them.

Does this help?

- Dennis 

reply via email to

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