* [PATCH] feed: merge subjects regardless of "[PATCH vN]"
@ 2015-08-25 9:05 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2015-08-25 9:05 UTC (permalink / raw)
To: meta
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-08-25 9:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-25 9:05 [PATCH] feed: merge subjects regardless of "[PATCH vN]" Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).