/** * Get last commits on the file. * * @param int $nbCommits Number of log entries to get * @return array Commit objects representing last modifications. */ public function log($nbCommits = 10) { $output = $this->repository->git('log -n %d %s -- %s', (int) $nbCommits, Commit::FORMAT, escapeshellarg($this->getRelativePathname())); return Commit::parse($this->repository, $output); }
/** * Return the result of `git log` formatted in a PHP array * * @param integer $nbCommits Limit of commits to get * @return array list of commits and their properties * */ public function log($nbCommits = 10) { $output = $this->git('log -n %d %s', $nbCommits, Commit::FORMAT); return Commit::parse($this, $output); }