2 require_once 'MTrack/Interface/CommitListener.php';
4 class MTrackCommitCheck_SingleIssue implements IMTrackCommitListener
8 function vetoCommit($msg, $files, $actions,$checker)
10 // checks for XXXX #123 - XXXX YYYY
11 if (!preg_match("/^\s*[a-z]+\s+#[0-9]+\s+-\s+[a-z]+\s/i", $msg)) {
13 return "Commit messages must include the exact issue being fixed and in the format\n\n'fix #123 - some description'\n\n You used\n'$msg'";
16 //asdfasdf #123, 234 ,34
19 preg_match_all("/[0-9]+/i", $msg,$ar);
20 if (count($ar[0]) != 1) {
21 return "Fix only one bug with each commit -
22 remove the changes that do not relate to this issue and commit again.";
29 function postCommit($msg, $files, $actions) {