now with reply threading and (basic) verb and noun stemming
authorJoey Hess <joey@kodama.kitenet.net>
Thu, 25 Oct 2007 08:21:28 +0000 (04:21 -0400)
committerJoey Hess <joey@kodama.kitenet.net>
Thu, 25 Oct 2007 08:21:28 +0000 (04:21 -0400)
fanboy

diff --git a/fanboy b/fanboy
index 7ca7eb4fd0388cea4fbce0550ca680a3e50e91b0..bff7173fb55a4722f1dc1e6bf75239207e401cae 100755 (executable)
--- a/fanboy
+++ b/fanboy
@@ -1,20 +1,46 @@
 #!/usr/bin/perl
 
 if (! @ARGV) {
-       @ARGV=qw(linus git linux rebase merge cherry-pick branch);
+       @ARGV=qw(linus git linux rebase redbased merge merged cherry-pick
+               branch branched branches);
 }
 
-my $coolstuff=join("|", map { "\Q$_\E" } @ARGV);
+my $coolstuff=join("|", map { "\Q$_\E" } reverse sort @ARGV);
 
 my $len=0;
+my $indent="";
+my $indent_printed=0;
 while (<STDIN>) {
-       while(/(($coolstuff)[.?!]*)/ig) {
-               $len+=length($1)+1;
-               if ($len > 70) {
-                       print "\n";
-                       $len=0;
+       if (/$coolstuff/) {
+               if (/^([>|][>|\s]*)/) {
+                       if ($indent ne $1) {
+                               print "\n" if $len;
+                               $len=0;
+                               $indent=$1;
+                               $indent_printed=0;
+                       }
+               }
+               else {
+                       if (length $indent && $indent_printed) {
+                               print "\n";
+                               $len=0;
+                       }
+                       $indent="";
+                       $indent_printed=0;
+               }
+
+               while(/(($coolstuff)[.?!]*)/ig) {
+                       $len+=length($1)+1;
+                       if ($len > 70) {
+                               print "\n";
+                               $len=0;
+                       }
+                       if (length $indent && ! $indent_printed) {
+                               print $indent;
+                               $indent_printed=1;
+                       }
+                       print $1." ";
                }
-               print $1." ";
        }
 }
 print "\n" if $len;
This page took 0.012649 seconds and 4 git commands to generate.