From 72c0f7c71ff28de9755dc4aee8b6ce6f0e4f2ed7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 25 Aug 2015 01:55:44 +0000 Subject: feed: merge subjects regardless of "[PATCH vN]" This normalizes rerolled patches with identical topics, but does not normalize different patches even if they are in the same thread (for now). --- lib/PublicInbox/Feed.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/PublicInbox') 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; -- cgit v1.2.3-24-ge0c7