GitWrapper\GitWorkingCopy::log PHP Method

log() public method

Show commit logs.
public log ( ) : GitWorkingCopy
return GitWorkingCopy
    public function log()
    {
        $args = func_get_args();
        array_unshift($args, 'log');
        return $this->run($args);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @param null $ref
  * @return int
  */
 public function getLog($ref = null)
 {
     $this->git->fetch();
     if (is_null($ref)) {
         $ref = $this->getCurrentBranchName();
     }
     $log = array_map(function ($entry) {
         $log = [];
         list($log['hash'], $log['message']) = explode(' ', $entry, 2);
         return $log;
     }, explode(PHP_EOL, trim($this->git->log($ref, ['oneline' => true])->getOutput())));
     return $log;
 }