[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Force a bugzilla in a gerrit commit

Thank you Eike.

On Fri, Sep 2, 2016 at 7:40 AM, Eike Stepper <stepper@xxxxxxxxxx> wrote:
Am 01.09.2016 um 23:43 schrieb Wim Jongman:
Hi,

Is it possible to automatically reject a Gerrit change when there is no associated valid bugzilla in the first line of the commit message?
I use this Ant target in my build script:

 <!-- ==================== -->
 <!-- Check Commit Message -->
 <!-- ==================== -->

 <target name="check.commit.msg" if="GERRIT_CHANGE_SUBJECT">
   <condition property="commit.msg.ok" value="true">
     <matches pattern="^\[[1-9][0-9]*\] .*$" string="${GERRIT_CHANGE_SUBJECT}"/>
   </condition>
   <fail message="The commit message is not of the form '[bug-id] bug-subject'." unless="commit.msg.ok"/>
 </target>

It doesn't actually check for a *valid* bug id, just for the correct syntax of the commit message.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



_______________________________________________
cross-project-issues-dev mailing list
cross-project-issues-dev@eclipse.org
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cross-project-issues-dev