[PATCH] contrib/nmbug/nmbug-status: if realname empty, use part of mailaddr
authorTomi Ollila <tomi.ollila@iki.fi>
Fri, 24 Aug 2012 17:29:21 +0000 (20:29 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:12 +0000 (09:49 -0800)
ee/028d2359b4eba1b4cfe13515be96ed8b56a8a5 [new file with mode: 0644]

diff --git a/ee/028d2359b4eba1b4cfe13515be96ed8b56a8a5 b/ee/028d2359b4eba1b4cfe13515be96ed8b56a8a5
new file mode 100644 (file)
index 0000000..85ce9a5
--- /dev/null
@@ -0,0 +1,69 @@
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 82D99431FAF\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Aug 2012 10:29:17 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id QBlD78mAEhpy for <notmuch@notmuchmail.org>;\r
+       Fri, 24 Aug 2012 10:29:15 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id 30E55431FAE\r
+       for <notmuch@notmuchmail.org>; Fri, 24 Aug 2012 10:29:15 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id 75BEE100386; Fri, 24 Aug 2012 20:29:23 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] contrib/nmbug/nmbug-status: if realname empty,\r
+       use part of mailaddr\r
+Date: Fri, 24 Aug 2012 20:29:21 +0300\r
+Message-Id: <1345829361-29851-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.1\r
+Cc: Tomi Ollila <tomi.ollila@iki.fi>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 24 Aug 2012 17:29:17 -0000\r
+\r
+When the From: field in patch email does not contain 'realname'\r
+field, the patch listing does not show anything as patch sender.\r
+In this case use the part before '@' in mail address as the sender\r
+identification in patch listing.\r
+---\r
+ contrib/nmbug/nmbug-status |    4 +++-\r
+ 1 files changed, 3 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/contrib/nmbug/nmbug-status b/contrib/nmbug/nmbug-status\r
+index f37ee84..9a334cc 100755\r
+--- a/contrib/nmbug/nmbug-status\r
++++ b/contrib/nmbug/nmbug-status\r
+@@ -90,7 +90,9 @@ def print_view(title, query, comment):\r
+                 val = str.join(' ', val.split(None)[1:4])\r
+                 val = str(datetime.datetime.strptime(val, '%d %b %Y').date())\r
+             elif header == 'from':\r
+-                val = rfc822.parseaddr(val)[0]\r
++                (val, addr) = rfc822.parseaddr(val)\r
++                if val == '':\r
++                    val = addr.split('@')[0]\r
\r
+             if last[header] == val:\r
+                 out[header] = ''\r
+-- \r
+1.7.1\r
+\r