releasing the trial release as stable
[rersyncrecent.git] / dagolden-reversion-gist.pl
blob0afa51a3233bfaff9f14b7d6720bdabeafeb6e67
1 #!/usr/bin/perl
3 # use 5.010;
4 use strict;
5 use warnings;
7 =head1 NAME
9 dagolden-reversion-gist
11 =head1 SYNOPSIS
13 perl $0 commitish
15 =head1 OPTIONS
17 =over 8
19 =cut
21 my @opt = <<'=back' =~ /B<--(\S+)>/g;
23 =item B<--help|h!>
25 This help
27 =back
29 =head1 DESCRIPTION
31 Found at https://gist.github.com/dagolden/858394
33 =head1 AUTHOR
35 From shebang to Local Variables it is dagolden, the rest is mine.
37 =cut
40 use FindBin;
41 use lib "$FindBin::Bin/../lib";
42 BEGIN {
43 push @INC, qw( );
46 use Dumpvalue;
47 use File::Basename qw(dirname);
48 use File::Path qw(mkpath);
49 use File::Spec;
50 use File::Temp;
51 use Getopt::Long;
52 use Pod::Usage;
53 use Hash::Util qw(lock_keys);
55 our %Opt;
56 lock_keys %Opt, map { /([^=|!]+)/ } @opt;
57 GetOptions(\%Opt,
58 @opt,
59 ) or pod2usage(1);
60 if ($Opt{help}) {
61 pod2usage(0);
64 #!/usr/bin/env perl
65 use 5.010;
66 use strict;
67 use warnings;
68 use autodie;
69 use Git::Wrapper;
70 use File::Find::Rule ();
71 use File::Find::Rule::Perl ();
73 my $tag = shift
74 or die "Usage: $0 <tag>\n";
76 my $git = Git::Wrapper->new(".");
78 my @files = File::Find::Rule->perl_file->in("lib");
80 for my $file ( @files ) {
81 my @diff = $git->diff( "$tag", "--", $file );
82 next unless @diff;
83 say "$file: " . scalar @diff . " diff lines";
84 my @version_lines = map { " $_" } grep { /\$(?:(?:\w+::)+)*VERSION\s*=\s*/ } @diff;
85 if ( @version_lines ) {
86 say for @version_lines;
88 else {
89 say " *** NEEDS VERSION BUMP! ***";
95 # Local Variables:
96 # mode: cperl
97 # cperl-indent-level: 4
98 # End: