protected function doParse()
{
$this->log = array();
while (!$this->isFinished()) {
$commit = array();
$this->consume('commit ');
$commit['id'] = $this->consumeHash();
$this->consumeNewLine();
$this->consume('tree ');
$commit['treeHash'] = $this->consumeHash();
$this->consumeNewLine();
$commit['parentHashes'] = array();
while ($this->expects('parent ')) {
$commit['parentHashes'][] = $this->consumeHash();
$this->consumeNewLine();
}
$this->consume('author ');
list($commit['authorName'], $commit['authorEmail'], $commit['authorDate']) = $this->consumeNameEmailDate();
$commit['authorDate'] = $this->parseDate($commit['authorDate']);
$this->consumeNewLine();
$this->consume('committer ');
list($commit['committerName'], $commit['committerEmail'], $commit['committerDate']) = $this->consumeNameEmailDate();
$commit['committerDate'] = $this->parseDate($commit['committerDate']);
// will consume an GPG signed commit if there is one
$this->consumeGPGSignature();
$this->consumeNewLine();
$this->consumeNewLine();
$message = '';
while ($this->expects(' ')) {
$message .= $this->consumeTo("\n") . "\n";
$this->consumeNewLine();
}
if (!$this->isFinished()) {
$this->consumeNewLine();
}
$commit['message'] = $message;
$this->log[] = $commit;
}
}