Skip to content

Commit

Permalink
A tool for finding out which commits haven't been documented yet
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Nov 15, 2017
1 parent 9096daf commit 99f38f9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions tools/build/missing-commits.pl6
@@ -0,0 +1,27 @@

# Helper sub: for a line, return commit ID or Nil
sub commit($line) { $line.starts-with('commit ') ?? $line.substr(7,8) !! Nil }

# The commit that did the last VERSION bump
my $version-bump-commit = commit( qx/git log -- VERSION/.lines.head );

# Make a SetHash with all of the commits since the last VERSION bump
my %commits is SetHash = qx/git log/.lines.map( {
if commit($_) -> \commit {
last if commit eq $version-bump-commit;
commit
}
} );

# Remove the commits that have been documented in ChangeLog since bump
# Note that we assume here that an empty line indicates boundary between
# releases.
%commits{ "docs/ChangeLog".IO.lines.map( {
$_
?? |.comb( / <?after \[> ( <[ 0..9 a..f A..F ]> ** 8 ) <?before \]> / )
!! last
} ) }:delete;

# Let the world know the result
say "%commits.elems() commits not yet documented in ChangeLog:";
%commits.keys.sort.batch(9).map: *.Str.say;

7 comments on commit 99f38f9

@AlexDaniel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What for? Releasable already does this. You can also give it a gist of an uncommitted changelog and it will report info about that. It also attempts to detect some mistakes (e.g. referenced commit does not exist, or the sha is of a different length). Also, if you mark in your commit message which commits should not be mentioned, releasable will not demand to log them.

@lizmat
Copy link
Contributor Author

@lizmat lizmat commented on 99f38f9 Nov 16, 2017 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vendethiel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a pretty nice example of many great Perl6 features. Definitely going to keep it around and lure people into learning the langage. :)

@AlexDaniel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO rakudo repo has enough unused, undocumented and undermaintained scripts. Maybe we should create a separate repo for all that.

@moritz
Copy link
Member

@moritz moritz commented on 99f38f9 Nov 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have a repo for examples: https://github.com/perl6/perl6-examples

@vendethiel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this repo also used for "real" scripts, though?

@AlexDaniel
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created this issue for further discussion: #1252

Please sign in to comment.