X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=mdiff-summarise.pl;fp=mdiff-summarise.pl;h=8b09d16fb6c0151cd1f658665bcc9230a1c92fa5;hb=1bf54832674f0b0c2ce1e4e21f3435d8ece030d0;hp=0000000000000000000000000000000000000000;hpb=0d1dc4c77ed28be37969cf537fee815437ed3c4b;p=vinegar-ip.git diff --git a/mdiff-summarise.pl b/mdiff-summarise.pl new file mode 100755 index 0000000..8b09d16 --- /dev/null +++ b/mdiff-summarise.pl @@ -0,0 +1,16 @@ +#!/usr/bin/perl -n +next if m/^\+/; +if (m/^[- ](\d+)$/) { + $nlno= $1; + next; +} elsif (defined $nlno) { + m/^[- ] *\S/ or die; + s/^([- ]) / $1. sprintf "%-6d ", $nlno /e; + undef $nlno; +} +die if defined $lno; +next if m/^[- ] \s\s/; +next if m/^\-\-\-|^\@\@/; +next if m/^ /; +die unless m/^\-/; +print or die $!;