From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.7 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, RP_MATCHES_RCVD shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 35D8B1FA55 for ; Tue, 25 Aug 2015 09:05:43 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] feed: merge subjects regardless of "[PATCH vN]" Date: Tue, 25 Aug 2015 09:05:43 +0000 Message-Id: <1440493543-18950-1-git-send-email-e@80x24.org> List-Id: 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(-) diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 969fc11..c1235c4 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; -- EW