$logs = str_replace("\n", ',', $logs);
$logs = json_decode("{ $logs }", true);
foreach ($logs as $log) {
$log['message'] = str_replace('-', ' ', $log['message']);
$commit = new Commit;
$commit->importData($log);
$commits[] = $commit;
}
return $commits;
}
public function getRelatedCommits($hash)
{
$logs = $this->getClient()->run($this, 'log --pretty=format:\'"%h": {"hash": "%H", "short_hash": "%h", "tree": "%T", "parent": "%P", "author": "%an", "author_email": "%ae", "date": "%at", "commiter": "%cn", "commiter_email": "%ce", "commiter_date": "%ct", "message": "%f"}\'');