From patchwork Wed Aug 9 11:10:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Engestrom X-Patchwork-Id: 9890347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6A86260384 for ; Wed, 9 Aug 2017 11:13:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60C4628A51 for ; Wed, 9 Aug 2017 11:13:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 53D2228A57; Wed, 9 Aug 2017 11:13:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1D29328A61 for ; Wed, 9 Aug 2017 11:13:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8780C6E2CA; Wed, 9 Aug 2017 11:13:01 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by gabe.freedesktop.org (Postfix) with ESMTP id B4C986E2C1; Wed, 9 Aug 2017 11:12:59 +0000 (UTC) Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id ECA5C7E29F55; Wed, 9 Aug 2017 12:12:55 +0100 (IST) Received: from localhost.localdomain (10.60.4.28) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 9 Aug 2017 12:12:58 +0100 From: Eric Engestrom To: Date: Wed, 9 Aug 2017 12:10:59 +0100 Message-ID: <20170809111101.11315-5-eric.engestrom@imgtec.com> X-Mailer: git-send-email 2.14.0 In-Reply-To: <20170809111101.11315-1-eric.engestrom@imgtec.com> References: <20170809111101.11315-1-eric.engestrom@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [10.60.4.28] Cc: Jani Nikula , Daniel Vetter , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [maintainer-tools PATCH 5/7] dim: move empty name logic to function X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Fair warning: this slightly changes the behaviour, as $testname would previously contain the email if $testcc didn't contain a name. Shouldn't affect anything though. Signed-off-by: Eric Engestrom --- dim | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/dim b/dim index 4ffac497c621..481a53e23035 100755 --- a/dim +++ b/dim @@ -1965,7 +1965,9 @@ function email_get_address function email_get_name { - sed -e 's/[[:space:]]*<.*$//' <<< "$1" + if grep -q '<' <<< "$1"; then + sed -e 's/[[:space:]]*<.*$//' <<< "$1" + fi } function dim_add_missing_cc @@ -1977,11 +1979,7 @@ function dim_add_missing_cc git show | scripts/get_maintainer.pl --email --norolestats --pattern-depth 1 | while read cc; do email="$(email_get_address "$cc")" - name='' - - if echo "$cc" | grep -q '<'; then - name="$(email_get_name "$cc")"; - fi + name="$(email_get_name "$cc")" # Don't add main mailing lists if [ "$email" = "dri-devel@lists.freedesktop.org" -o \