method logs documentation in bbn\Api\Git
function(int $start = 0, int $limit = 0)
{
/*
for get info the commits
%n new line,
%an author,
%h hash commit abbrev.
%H hash commit
%ad date
%cN committer
%N note commit
*/
$cmd = 'git log --pretty=format:"%h%n%H%n%an%n%s%n%ae%n%ad%n%cN%n%N%n__commit__" --date=format-local:"%Y-%m-%d %H:%M:%S" --skip='.$start;
if ( $limit > 0 ){
$cmd .= ' --max-count='.$limit;
}
$field = ['sha1', 'commit', 'author', 'title_commit', 'email_author', 'date', 'committer', 'notes'];
$commits = [];
$arr = [];
$i = 0;
$logs = $this->extractFromCommand($cmd);
foreach( $logs as $val ){
if ( $val !== '__commit__' ){
$arr[$field[$i]] = $val;
$i++;
}
else {
$commits[] = $arr;
$i = 0;
}
}
return [
'commits' => $commits,
'total' => (int)$this->extractFromCommand('git rev-list --all --count')[0]
];
}
BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way
This website uses cookies to ensure you get the best experience on our website.
© 2011-2023
BBN Solutions