for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* This file is part of CaptainHook.
*
* (c) Sebastian Feldmann <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace SebastianFeldmann\Git\Operator;
use SebastianFeldmann\Git\Command\Log\ChangedFiles;
use SebastianFeldmann\Git\Command\Log\Commits;
class Log extends Base
{
* Get the list of files that changed since a given revision.
* @param string $revision
* @return array
public function getChangedFilesSince(string $revision) : array
$cmd = (new ChangedFiles($this->repo->getRoot()))->byRevision($revision);
$result = $this->runner->run($cmd);
return $result->getOutput();
}
* Get list of commits since given revision.
public function getCommitsSince(string $revision) : array
$cmd = (new Commits($this->repo->getRoot()))->byRevision($revision)
->prettyFormat(Commits\Jsonized::FORMAT);
$formatter = new Commits\Jsonized();
$result = $this->runner->run($cmd, $formatter);
return $result->getFormattedOutput();