my (%headercount, @headercache);
while (readline) {
- s/(.+)\n//m;
+ s/^([0-9a-f]{4,40})\n//m and
my $hash = $1;
# strip commit seperator
# if invalid, assume it's latin1
$_ = decode(cp1252 => $_) if $@;
- my $prefix = 0;
my %attr;
BLOCK:
for (reverse split /\n\n/) {
my @headers;
+ my $prefix = 0;
LINE:
for (split /\n/) {
next BLOCK if not @headers;
if ($opt{debug} and $prefix) {
- say "infix junk in commit $hash";
+ say sprintf ': invalid lines in %s (%s)', $hash // 'block', $prefix;
}
for (@headers) {
my $line = $_->[2] // join(': ', @$_);
+ $line =~ s/^/$hash / if defined $hash;
+
if (defined $opt{min} or $opt{max}) {
my $counter = \$headercount{ $_->[0] }->{ $_->[1] // '' };
my $excess = $$counter++ - ($opt{min} // 0);