Skip to content

Commit

Permalink
Add --debug flag to contrib tool
Browse files Browse the repository at this point in the history
That dumps some extra info about found contributors,
to help find any issues with the genned list of contributors
  • Loading branch information
zoffixznet committed Jul 5, 2018
1 parent c5cfbc6 commit f6c8159
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tools/contributors.p6
Expand Up @@ -18,6 +18,7 @@ multi MAIN('for', 'release', $release,
PathToRepo :$nqp = NQP_REPO, PathToRepo :$nqp = NQP_REPO,
PathToRepo :$moar = MOAR_REPO, PathToRepo :$moar = MOAR_REPO,
PathToRepo :$roast = ROAST_REPO, PathToRepo :$roast = ROAST_REPO,
Bool :$debug,
) { ) {
# fetch all available tags, creating a list of hashes, each of which got # fetch all available tags, creating a list of hashes, each of which got
# a tag name and the date it was created on # a tag name and the date it was created on
Expand All @@ -41,7 +42,7 @@ multi MAIN('for', 'release', $release,
# the tag that's previous to it, temporally, giving us the space of one rls # the tag that's previous to it, temporally, giving us the space of one rls
say join ', ', committers :since(%prev-rel{$release}<date>), say join ', ', committers :since(%prev-rel{$release}<date>),
:until(@releases.first(*.<tag> eq $release)<date>), :until(@releases.first(*.<tag> eq $release)<date>),
:$rakudo, :$doc, :$nqp, :$moar, :$roast :$rakudo, :$doc, :$nqp, :$moar, :$roast, :$debug,
} }


#|(current release) #|(current release)
Expand All @@ -50,7 +51,8 @@ multi MAIN ($last_release? is copy,
PathToRepo :$doc = DOC_REPO, PathToRepo :$doc = DOC_REPO,
PathToRepo :$nqp = NQP_REPO, PathToRepo :$nqp = NQP_REPO,
PathToRepo :$moar = MOAR_REPO, PathToRepo :$moar = MOAR_REPO,
PathToRepo :$roast = ROAST_REPO PathToRepo :$roast = ROAST_REPO,
Bool :$debug,
) { ) {
$last_release //= get-last-release-date-for $rakudo; $last_release //= get-last-release-date-for $rakudo;
say join ', ', committers since => $last_release, say join ', ', committers since => $last_release,
Expand Down Expand Up @@ -87,6 +89,7 @@ sub committers (
:$nqp = NQP_REPO, :$nqp = NQP_REPO,
:$moar = MOAR_REPO, :$moar = MOAR_REPO,
:$roast = ROAST_REPO, :$roast = ROAST_REPO,
:$debug,
) { ) {
# Check all the places with repos that may be applicable. Get all of the # Check all the places with repos that may be applicable. Get all of the
# committers in that repo since the given date as commit ID => author pairs. # committers in that repo since the given date as commit ID => author pairs.
Expand All @@ -109,9 +112,15 @@ sub committers (


say "Contributors to Rakudo since $since" say "Contributors to Rakudo since $since"
~ (" until $until" with $until) ~ ":"; ~ (" until $until" with $until) ~ ":";

my @contributors = @repos.map({ my @contributors = @repos.map({
|get-committers($_, $since, |($_ with $until)) my @comms = get-committers($_, $since, |($_ with $until));
}).unique(:as(*.key))».value.Bag.sort({-.value, .key})».key; $debug and @comms.map: { dd [.key, .value, $_] }
|@comms
}).unique(:as(*.key))».value.Bag.sort({-.value, .key});

$debug and dd @contributors;
@contributors = @contributors».key;


for @contributors -> $name is rw { for @contributors -> $name is rw {
state $length = 0; state $length = 0;
Expand Down

0 comments on commit f6c8159

Please sign in to comment.