Skip to content

Commit 4b6a85e

Browse files
committed
check-release.pl: also list the commit total
When filtering the commits to only those relevant, it is still nice to know the total number of commits since the last release, even if some of them got filtered out. So let's list the commits as "x/y" where x is the number of relevant commits, and y is the total since last release. Requested by Mark Hiner.
1 parent 6316c30 commit 4b6a85e

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

check-release.pl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,7 @@ ($$$)
195195

196196
if ($verbose || $commitCount > 0) {
197197
# new commits on master; a release is potentially needed
198-
print "$ga: $commitCount commits on master since $release_version\n";
198+
my @allCommits = `git rev-list $releaseRef...origin/master`;
199+
my $totalCommits = @allCommits;
200+
print "$ga: $commitCount/$totalCommits commits on master since $release_version\n";
199201
}

prettify-status.pl

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ ($$)
3333

3434
for my $line (sort @lines) {
3535
chomp $line;
36-
if ($line =~ /([^:]+):([^:]+): (\d+) commits on (\w+) since (.*)/) {
36+
if ($line =~ /([^:]+):([^:]+): (\d+)\/(\d+) commits on (\w+) since (.*)/) {
3737
my $groupId = $1;
3838
my $artifactId = $2;
3939
my $commitCount = $3;
40-
my $branch = $4;
41-
my $version = $5;
40+
my $totalCommits = $4;
41+
my $branch = $5;
42+
my $version = $6;
4243
my $tag = $version ? "$artifactId-$version" : "";
4344
my $org = $orgs{$groupId};
4445
if (!$org) { $org = $groupId; }
@@ -47,14 +48,15 @@ ($$)
4748
my $link = "https://github.com/$orgs{$groupId}/$repo";
4849

4950
my $data = {
50-
groupId => $groupId,
51-
artifactId => $artifactId,
52-
commitCount => $commitCount,
53-
branch => $branch,
54-
version => $version,
55-
tag => $tag,
56-
org => $org,
57-
repo => $repo,
51+
groupId => $groupId,
52+
artifactId => $artifactId,
53+
commitCount => $commitCount,
54+
totalCommits => $totalCommits,
55+
branch => $branch,
56+
version => $version,
57+
tag => $tag,
58+
org => $org,
59+
repo => $repo,
5860
};
5961

6062
if (not $org) {
@@ -73,7 +75,7 @@ ($$)
7375
# a release is needed
7476
$data->{line} = "<td class=\"first\"></td>\n" .
7577
"<td><a href=\"$link\">$artifactId</a></td>\n" .
76-
"<td><a href=\"$link/compare/$tag...$branch\">$commitCount</a></td>\n" .
78+
"<td><a href=\"$link/compare/$tag...$branch\">$commitCount/$totalCommits</a></td>\n" .
7779
"<td><a href=\"$link/tree/$tag\">$version</a></td>\n";
7880
push @ahead, $data;
7981
}

0 commit comments

Comments
 (0)