From patchwork Tue Aug 29 21:48:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 807326 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="VsIBRTOm"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xhj2w4TP7z9s7F for ; Wed, 30 Aug 2017 07:49:27 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DF2D3C2269A; Tue, 29 Aug 2017 21:49:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 85AE1C2201C; Tue, 29 Aug 2017 21:49:07 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 87CEBC2201C; Tue, 29 Aug 2017 21:49:05 +0000 (UTC) Received: from mail-pf0-f194.google.com (mail-pf0-f194.google.com [209.85.192.194]) by lists.denx.de (Postfix) with ESMTPS id 30F51C2201C for ; Tue, 29 Aug 2017 21:49:03 +0000 (UTC) Received: by mail-pf0-f194.google.com with SMTP id g13so3102484pfm.2 for ; Tue, 29 Aug 2017 14:49:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=nZdI9RXSRcI7k5y6imbqt41qpe5BDo9AiZvZJMy9YEE=; b=VsIBRTOmOZTojBegEv8caDyRlM29NSDFL9uPFfCDSZodk7ksjjULXWqrrQuvu9OCui G3RNZ0RwGLtfKNat2eF/kCylUBNHS2a8LW3L5/MeNLCnFuO8lLNzk5RnUcjzLoYZGnvI TRzkec019RcSbptHxKW+WYzlUqps/aY+PGKIPajttO28/bTBw9VOAIymUguaO9gp3jvs dx9oW459zfD7mt4/rFsQ84nYDA+cuWouamRMjOayc7NKTUcnBghqFdVTXSqo2Ha+HzwA P55gpyAFFW+Vxjuo9Q68cKz6ckUT/O16d7RHjXgVB3jtJq8SZujTarRsHLOUWjl/Ax6N lWdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=nZdI9RXSRcI7k5y6imbqt41qpe5BDo9AiZvZJMy9YEE=; b=A69z2wn2mqkNxv67lHT03Pwh7xiO0Z91+kqJmRph0hNkNyeoMoAyCDxcij4SGZ0NS3 wsHvs52L1mrwpDpnuwxc7s5fRILlMVkMBSz319R90UVX3aumrjlRRr90pOuUyVhO6s0o Nm0lY/hSOt/mNco81PRzszPMIxjCS13/KBcgcux/Ol3JVV1Zg0/OBWH95nBpvnO03Rji 1bO/NAIl0E1/9sGmPVGyFzJXiLK9v064Yd1UfZNEhCTL44ayoE1EeL/EAVbHNOHK/4or qdNREBcqh9PTRzxc97XJjlUr06e/o/298WZCEmpveshAF1a/ERHvoHAy6XP0a505VnH2 ctkg== X-Gm-Message-State: AHYfb5hkOFWpr1A8Nc2F9W/vHBiTSdLgdWnD3wuUMRXLlNHHib4LRTQU WWxsjbE9wMQCwoj8QQQ= X-Received: by 10.98.84.194 with SMTP id i185mr1756442pfb.103.1504043341131; Tue, 29 Aug 2017 14:49:01 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id d69sm5579344pgc.82.2017.08.29.14.48.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Aug 2017 14:49:00 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Wed, 30 Aug 2017 09:48:52 +1200 Message-Id: <20170829214852.22661-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.14.1 Cc: Chris Packham Subject: [U-Boot] [PATCH v2] patman: add support for omitting bouncing addresses X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Add support for reading a list of bouncing addresses from a in-tree file (doc/bounces) and from the ~/.patman config file. These addresses are stripped from the Cc list. Signed-off-by: Chris Packham Reviewed-by: Simon Glass --- This version supports an in-tree doc/bounces file as well as a section in the .patman config file. A slight annoyance is the config file parser expects key: value pairs whereas the bounces file is just a flat list. I started looking a modeling this after the aliases but then I actually thought that if we do want to tag someone as a bouncing address we probably want to be explicit about it. Changes in v2: - better integration with existing configuration - documentation doc/bounces | 3 +++ tools/patman/README | 12 ++++++++++++ tools/patman/series.py | 2 ++ tools/patman/settings.py | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 doc/bounces diff --git a/doc/bounces b/doc/bounces new file mode 100644 index 000000000000..d1c5f0d246eb --- /dev/null +++ b/doc/bounces @@ -0,0 +1,3 @@ +# List of addresses picked up by patman/get_maintainer.pl that are known to +# bounce. Addresses are listed one per line and need to match the author +# information recorded in git. diff --git a/tools/patman/README b/tools/patman/README index e36857dedea1..8582ed6ba12c 100644 --- a/tools/patman/README +++ b/tools/patman/README @@ -84,6 +84,18 @@ Aliases are recursive. The checkpatch.pl in the U-Boot tools/ subdirectory will be located and used. Failing that you can put it into your path or ~/bin/checkpatch.pl +If you want to avoid sending patches to email addresses that are picked up +by patman but are known to bounce you can add a [bounces] section to your +.patman file. Unlike the [alias] section these are simple key: value pairs +that are not recursive. + +>>> + +[bounces] +gonefishing: Fred Bloggs + +<<< + If you want to change the defaults for patman's command-line arguments, you can add a [settings] section to your .patman file. This can be used diff --git a/tools/patman/series.py b/tools/patman/series.py index d3947a7c2ac5..ddc0993d9eac 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -10,6 +10,7 @@ import os import get_maintainer import gitutil +import settings import terminal # Series-xxx tags that we understand @@ -233,6 +234,7 @@ class Series(dict): cc += add_maintainers elif add_maintainers: cc += get_maintainer.GetMaintainer(commit.patch) + cc = set(cc) - set(settings.bounces) cc = [m.encode('utf-8') if type(m) != str else m for m in cc] all_ccs += cc print(commit.patch, ', '.join(set(cc)), file=fd) diff --git a/tools/patman/settings.py b/tools/patman/settings.py index 5f207f5ef1c4..d735ff9ba3c6 100644 --- a/tools/patman/settings.py +++ b/tools/patman/settings.py @@ -269,6 +269,19 @@ def _ReadAliasFile(fname): if bad_line: print(bad_line) +def _ReadBouncesFile(fname): + """Read in the bounces file if it exists + + Args: + fname: Filename to read. + """ + if os.path.exists(fname): + with open(fname) as fd: + for line in fd: + if line.startswith('#'): + continue + bounces.add(line.strip()) + def Setup(parser, project_name, config_fname=''): """Set up the settings module by reading config files. @@ -293,10 +306,15 @@ def Setup(parser, project_name, config_fname=''): for name, value in config.items('alias'): alias[name] = value.split(',') + _ReadBouncesFile('doc/bounces') + for name, value in config.items('bounces'): + bounces.add(value) + _UpdateDefaults(parser, config) # These are the aliases we understand, indexed by alias. Each member is a list. alias = {} +bounces = set() if __name__ == "__main__": import doctest