title: Trigger Teamcity build on successful Git merge
body: <p>We want our Teamcity server to do an automatic build whenever someone merges something back to the master branch.</p>
  
  <p>To do this we have created a new VCS Trigger and checked the <code>Trigger a build on each check-in</code>-option. We have disabled the <code>Quiet period mode</code> and added a regular expression for the trigger rule.
  Checking out the <a href="http://docs.oracle.com/javase/1.5.0/docs/api/java/util/regex/Pattern.html" rel="nofollow">Java regex documentation</a> I've created the following regex:
  <code>^Merge branch '[a-zA-Z0-9\p{Punct}]+' into 'master'$</code> which translates to the following in the <strong>Trigger rules</strong> textblock: <code>+:comment=^Merge branch '[a-zA-Z0-9\p{Punct}]+' into 'master'$</code> or <code>+:comment=^Merge branch '[a-zA-Z0-9\p{Punct}]+' into 'master'$:**</code> (I haven't got the slightest idea what <code>:**</code> should do, but the <a href="https://confluence.jetbrains.com/display/TCD8/Configuring+VCS+Triggers" rel="nofollow">TC documentation</a> uses this sometimes)</p>
  
  <p>This should match something like:</p>
  
  <blockquote>
    <p>Merge branch 'test' into 'master'</p>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <p>Merge branch 'feature-cs-200' into 'master'</p>
  </blockquote>
  
  <p>However, the builds are never triggered. Apparently the regex doesn't match the correct pattern.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>Finished...</strong>
  Apparently Teamcity has decided the <code>+:comment=^Merge branch '[a-zA-Z0-9\p{Punct}]+' into 'master'$</code> regex is fine now and triggers the builds whenever a commit message matches the examples. Perhaps there was some caching or something else which caused the trigger not to fire.</p>