about summary refs log tree commit homepage
path: root/lib/PublicInbox/Feed.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-25 01:55:44 +0000
committerEric Wong <e@80x24.org>2015-08-25 09:06:02 +0000
commit72c0f7c71ff28de9755dc4aee8b6ce6f0e4f2ed7 (patch)
tree564a5b73b1b8ecf662907b1efe4aaaf64fcf117a /lib/PublicInbox/Feed.pm
parent73214b02e581ef0a037d85a1ae37ff425654d7b3 (diff)
downloadpublic-inbox-72c0f7c71ff28de9755dc4aee8b6ce6f0e4f2ed7.tar.gz
This normalizes rerolled patches with identical topics,
but does not normalize different patches even if they are
in the same thread (for now).
Diffstat (limited to 'lib/PublicInbox/Feed.pm')
-rw-r--r--lib/PublicInbox/Feed.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm
index 69ce59bd..a0f901eb 100644
--- a/lib/PublicInbox/Feed.pm
+++ b/lib/PublicInbox/Feed.pm
@@ -332,8 +332,12 @@ sub add_topic {
                 $subj = mime_header($header_obj, 'Subject');
         }
 
-        $subj = $srch->subject_normalized($subj);
-        if (++$subjs->{$subj} == 1) {
+        my $topic = $subj = $srch->subject_normalized($subj);
+
+        # kill "[PATCH v2]" etc. for summarization
+        $topic =~ s/\A\s*\[[^\]]+\]\s*//g;
+
+        if (++$subjs->{$topic} == 1) {
                 unless ($header_obj) {
                         my $mime = do_cat_mail($git, $path) or return 0;
                         $header_obj = $mime->header_obj;