Closed Tux closed 6 years ago
Have you looked at https://metacpan.org/pod/Pithub::Repos#commits ?
Yes, I did: see the last code snippet in above post. My ultimate goal is to get all the (recent) information about a repo into a single line of status/states, where I gather info from github, CPAN, and possible other sources like MetaCPAN and CPANTESTERS. Things I like te see on the dashboard are
All of those give me insight in how active the package is maintained
Maybe things have changed a bit since 2016 (!), but I'm not sure if this issue is still in need of attention, since the desired behaviour is already provided with the existing API (even if in some cases it might be a bit verbose).
For example:
Last commit [...] per branch
my $result = $repo->branches;
while ( my $branch = $result->next ) {
my $sha = $branch->{commit}{sha};
my $commit = $repo->commits->get( sha => $sha )->content;
printf "%s (%.8s) %s\n",
$branch->{name}, $sha, $commit->{commit}{committer}{date};
}
If not, then maybe I'm just not understanding the issue, but I fail to see how a method like the one described could be implemented in a way that does not collide with the current API.
2016 indeed, and as nothing changed, I moved on to using other methods.
Looks like we can close this one. Feel free to reach out to me if I'm wrong.
I'd like to see a method that returns me commits, like
Currently, ->content returns the most recent stamp for when the repo was pushed, but pashed_at does not tell me anything about the last commit for the default/stable branch, which - on a dashboard - imho is much more useful to show. If I read the docs correct, the commits can currently be fetched like
Which seems to limit to the 100 most recent commits, and the list does not include branch information.