#!/usr/bin/env raku use v6; my %*SUB-MAIN-OPTS = :named-anywhere; # repeat named args in MAIN multies for nice USAGE messsages constant RAK_REPO = '.'; constant DOC_REPO = '../doc'; constant NQP_REPO = 'nqp'; constant MOAR_REPO = 'nqp/MoarVM'; constant ROAST_REPO = 't/spec'; subset PathToRepo of Str where .so; #|(past releases) multi MAIN('for', 'release', $release, PathToRepo :$rakudo = RAK_REPO, PathToRepo :$doc = DOC_REPO, PathToRepo :$nqp = NQP_REPO, PathToRepo :$moar = MOAR_REPO, PathToRepo :$roast = ROAST_REPO, Bool :$debug, ) { # fetch all available tags, creating a list of hashes, each of which got # a tag name and the date it was created on my @releases = run(:out, :cwd($rakudo), «git for-each-ref --sort=taggerdate '--format=%(tag)|%(creatordate)' refs/tags» ).out.lines(:close).map( *.split('|', :skip-empty).List ).grep(* == 2).map: { %(:tag(.head), :date(parse-date .tail)) }; ~$release ∈ @releases». or die "Could not find $release in the list of" ~ " known releases: @releases»."; # create a map of tag => the tag immediatelly previous to it (temporally) # this gives us the tag (along with that tag's date) for the previous rls my %prev-rel = @releases.rotor(2 => -1).map: {.tail => .head }; %prev-rel{$release} or die "Could not figure out the tag for previous" ~ " release. Did you give me the first release ever? I can't handle it"; # gen committers using the dates of the tag we were asked for and the # the tag that's previous to it, temporally, giving us the space of one rls say join ', ', committers :since(%prev-rel{$release}), :until(@releases.first(*. eq $release)), :$rakudo, :$doc, :$nqp, :$moar, :$roast, :$debug, } #|(current release) multi MAIN ($last_release? is copy, PathToRepo :$rakudo = RAK_REPO, PathToRepo :$doc = DOC_REPO, PathToRepo :$nqp = NQP_REPO, PathToRepo :$moar = MOAR_REPO, PathToRepo :$roast = ROAST_REPO, Bool :$debug, ) { $last_release //= get-last-release-date-for $rakudo; say join ', ', committers since => $last_release, :$rakudo, :$doc, :$nqp, :$moar, :$roast } sub parse-date ($date) { # newer gits have `--date` option to set format; I don't have such a new # git, so do this business of extracting the date: # 'Fri Feb 23 08:03:10 2018 +0200' # Thu Feb 26 23:51:11 2009 -0600 if $date ~~ / $=\w**3 \s+ $=\w**3 \s+ $=\d+ \s+ $