src/Robo/Commands/Git/GitCommand.php
public function commitMsgHook($message) {
    $this->say('Validating commit message syntax...');
    $pattern = $this->getConfigValue('git.commit-msg.pattern');
    $help_description = $this->getConfigValue('git.commit-msg.help_description');
    $example = $this->getConfigValue('git.commit-msg.example');
    $this->logger->debug("Validing commit message with regex <comment>$pattern</comment>.");
    if (!preg_match($pattern, $message)) {
      $this->logger->error("Invalid commit message!");
      $this->say("Commit messages must conform to the regex $pattern");
      if (!empty($help_description)) {
        $this->say("$help_description");
      }
      if (!empty($example)) {
        $this->say("Example: $example");
      }
      $this->logger->notice("To disable or customize Git hooks, see http://blt.rtfd.io/en/latest/readme/extending-blt/#git-hooks");

      return 1;
    }

    return 0;
  }
public function commitMsgHook($message) {
    $this->say('Validating commit message syntax...');
    $pattern = $this->getConfigValue('git.commit-msg.pattern');
    $help_description = $this->getConfigValue('git.commit-msg.help_description');
    $example = $this->getConfigValue('git.commit-msg.example');
    $this->logger->debug("Validing commit message with regex <comment>$pattern</comment>.");
    if (!preg_match($pattern, $message)) {
      $this->logger->error("Invalid commit message!");
      $this->say("Commit messages must conform to the regex $pattern");
      if (!empty($help_description)) {
        $this->say("$help_description");
      }
      if (!empty($example)) {
        $this->say("Example: $example");
      }
      $this->logger->notice("To disable or customize Git hooks, see http://blt.rtfd.io/en/latest/readme/extending-blt/#git-hooks");

      return 1;
    }

    return 0;
  }
public function commitMsgHook ( $ message ) { $ this -> say ( 'Validating commit message syntax...' ) ; $ pattern = $ this -> getConfigValue ( 'git.commit-msg.pattern' ) ; $ help_description = $ this -> getConfigValue ( 'git.commit-msg.help_description' ) ; $ example = $ this -> getConfigValue ( 'git.commit-msg.example' ) ; $ this -> logger -> debug ( "Validing commit message with regex <comment>$pattern</comment>." ) ; if ( ! preg_match ( $ pattern , $ message ) ) { $ this -> logger -> error ( "Invalid commit message!" ) ; $ this -> say ( "Commit messages must conform to the regex $pattern" ) ; if ( ! empty ( $ help_description ) ) { $ this -> say ( "$help_description" ) ; } if ( ! empty ( $ example ) ) { $ this -> say ( "Example: $example" ) ; } $ this -> logger -> notice ( "To disable or customize Git hooks, see http://blt.rtfd.io/en/latest/readme/extending-blt/#git-hooks" ) ; return 1 ; } return 0 ; }
Validates a git commit message.

@command internal:git-hook:execute:commit-msg
@aliases git:commit-msg
@hidden

@return int
Validates a git commit message .