Skip to main content

[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:

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}"/>
      <fail message="The commit message is not of the form '[bug-id] bug-subject'." unless="commit.msg.ok"/>

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



cross-project-issues-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top