From: Joey Hess Date: Thu, 25 Oct 2007 08:21:28 +0000 (-0400) Subject: now with reply threading and (basic) verb and noun stemming X-Git-Tag: 2.43~8 X-Git-Url: http://git.ieval.ro/?p=filters.git;a=commitdiff_plain;h=80e2e3ff2cd8f80d373d5040247433f67434704a now with reply threading and (basic) verb and noun stemming --- diff --git a/fanboy b/fanboy index 7ca7eb4..bff7173 100755 --- 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 () { - 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;