Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated 'phing changelog' to work with new commit tags

  • Loading branch information...
commit 1ca61a5c221bd3b04553d69a60aa6ec55c2ead86 1 parent 17303c6
Ingo Schommer chillu authored sminnee committed
Showing with 6 additions and 7 deletions.
  1. +6 −7 tools/CreateChangelog.php
13 tools/CreateChangelog.php
View
@@ -18,11 +18,10 @@ class CreateChangelog extends SilverStripeBuildTask {
* Order of the array keys determines order of the lists.
*/
public $types = array(
- 'API Changes' => array('/^API CHANGE:?/i','/^APICHANGE?:?/i'),
- 'Features and Enhancements' => array('/^(ENHANCEMENT|ENHNACEMENT):?/i', '/^FEATURE:?/i'),
- 'Bugfixes' => array('/^(BUGFIX|BUGFUX):?/i','/^BUG FIX:?/i'),
- 'Minor changes' => array('/^MINOR:?/i'),
- 'Other' => array('/^[^A-Z][^A-Z][^A-Z]/') // dirty trick: check for uppercase characters
+ 'API Changes' => array('/^(APICHANGE|API-CHANGE|API CHANGE|API)\s?:?/i'),
+ 'Features and Enhancements' => array('/^(ENHANCEMENT|ENHNACEMENT|FEATURE|NEW)\s?:?/i'),
+ 'Bugfixes' => array('/^(BUGFIX|BUGFUX|BUG)\s?:?/i','/^(BUG FIX)\s?:?/i'),
+ 'Other' => array('/^(MINOR)\s?:?/i')
);
public $commitUrls = array(
@@ -144,9 +143,9 @@ function sortByType($commits) {
foreach($this->types as $name => $rules) {
if(!isset($groupedByType[$name])) $groupedByType[$name] = array();
foreach($rules as $rule) {
- if(!$matched && preg_match($rule, $commit['message'])) {
+ if(!$matched && preg_match($rule, $commit['message'], $matches)) {
// @todo The fallback rule on other can't be replaced, as it doesn't match a full prefix
- $commit['message'] = ($name != 'Other') ? trim(preg_replace($rule, '', $commit['message'])) : $commit['message'];
+ $commit['message'] = trim(preg_replace($rule, '', $commit['message']));
$groupedByType[$name][] = $commit;
$matched = true;
}
Please sign in to comment.
Something went wrong with that request. Please try again.