Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A tool for finding out which commits haven't been documented yet
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; |
99f38f9
There was a problem hiding this comment.
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.
99f38f9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
99f38f9
There was a problem hiding this comment.
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. :)
99f38f9
There was a problem hiding this comment.
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.
99f38f9
There was a problem hiding this comment.
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
99f38f9
There was a problem hiding this comment.
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?
99f38f9
There was a problem hiding this comment.
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