[{"id":1760951,"web_url":"http://patchwork.ozlabs.org/comment/1760951/","msgid":"<CAPnjgZ1Gv90fG=hbSHYM2D1uUmqmP-wk3DJMg7EvJCWj2noMzw@mail.gmail.com>","list_archive_url":null,"date":"2017-08-31T12:52:36","subject":"Re: [U-Boot] [PATCH v2] patman: add support for omitting bouncing\n\taddresses","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"Hi Chris,\n\nOn 30 August 2017 at 05:48, Chris Packham <judge.packham@gmail.com> wrote:\n> Add support for reading a list of bouncing addresses from a in-tree file\n> (doc/bounces) and from the ~/.patman config file. These addresses are\n> stripped from the Cc list.\n>\n> Signed-off-by: Chris Packham <judge.packham@gmail.com>\n> ---\n> This version supports an in-tree doc/bounces file as well as a section\n> in the .patman config file. A slight annoyance is the config file parser\n> expects key: value pairs whereas the bounces file is just a flat list. I\n> started looking a modeling this after the aliases but then I actually\n> thought that if we do want to tag someone as a bouncing address we\n> probably want to be explicit about it.\n>\n> Changes in v2:\n> - better integration with existing configuration\n> - documentation\n>\n>  doc/bounces              |  3 +++\n>  tools/patman/README      | 12 ++++++++++++\n>  tools/patman/series.py   |  2 ++\n>  tools/patman/settings.py | 18 ++++++++++++++++++\n>  4 files changed, 35 insertions(+)\n>  create mode 100644 doc/bounces\n>\n\nReviewed-by: Simon Glass <sjg@chromium.org>\n\n> diff --git a/doc/bounces b/doc/bounces\n> new file mode 100644\n> index 000000000000..d1c5f0d246eb\n> --- /dev/null\n> +++ b/doc/bounces\n> @@ -0,0 +1,3 @@\n> +# List of addresses picked up by patman/get_maintainer.pl that are known to\n> +# bounce. Addresses are listed one per line and need to match the author\n> +# information recorded in git.\n> diff --git a/tools/patman/README b/tools/patman/README\n> index e36857dedea1..8582ed6ba12c 100644\n> --- a/tools/patman/README\n> +++ b/tools/patman/README\n> @@ -84,6 +84,18 @@ Aliases are recursive.\n>  The checkpatch.pl in the U-Boot tools/ subdirectory will be located and\n>  used. Failing that you can put it into your path or ~/bin/checkpatch.pl\n>\n> +If you want to avoid sending patches to email addresses that are picked up\n> +by patman but are known to bounce you can add a [bounces] section to your\n> +.patman file. Unlike the [alias] section these are simple key: value pairs\n> +that are not recursive.\n> +\n> +>>>\n> +\n> +[bounces]\n> +gonefishing: Fred Bloggs <f.bloggs@napier.net>\n> +\n> +<<<\n> +\n>\n>  If you want to change the defaults for patman's command-line arguments,\n>  you can add a [settings] section to your .patman file.  This can be used\n> diff --git a/tools/patman/series.py b/tools/patman/series.py\n> index d3947a7c2ac5..ddc0993d9eac 100644\n> --- a/tools/patman/series.py\n> +++ b/tools/patman/series.py\n> @@ -10,6 +10,7 @@ import os\n>\n>  import get_maintainer\n>  import gitutil\n> +import settings\n>  import terminal\n>\n>  # Series-xxx tags that we understand\n> @@ -233,6 +234,7 @@ class Series(dict):\n>                  cc += add_maintainers\n>              elif add_maintainers:\n>                  cc += get_maintainer.GetMaintainer(commit.patch)\n> +            cc = set(cc) - set(settings.bounces)\n\nCan you please arrange for it to print out the email addresses that\nare skipped? I think it might be very confusing if someone tries to\nsend to an address and it does not work.\n\n>              cc = [m.encode('utf-8') if type(m) != str else m for m in cc]\n>              all_ccs += cc\n>              print(commit.patch, ', '.join(set(cc)), file=fd)\n> diff --git a/tools/patman/settings.py b/tools/patman/settings.py\n> index 5f207f5ef1c4..d735ff9ba3c6 100644\n> --- a/tools/patman/settings.py\n> +++ b/tools/patman/settings.py\n> @@ -269,6 +269,19 @@ def _ReadAliasFile(fname):\n>          if bad_line:\n>              print(bad_line)\n>\n> +def _ReadBouncesFile(fname):\n> +    \"\"\"Read in the bounces file if it exists\n> +\n> +    Args:\n> +        fname: Filename to read.\n> +    \"\"\"\n> +    if os.path.exists(fname):\n> +        with open(fname) as fd:\n> +            for line in fd:\n> +                if line.startswith('#'):\n> +                    continue\n> +                bounces.add(line.strip())\n> +\n>  def Setup(parser, project_name, config_fname=''):\n>      \"\"\"Set up the settings module by reading config files.\n>\n> @@ -293,10 +306,15 @@ def Setup(parser, project_name, config_fname=''):\n>      for name, value in config.items('alias'):\n>          alias[name] = value.split(',')\n>\n> +    _ReadBouncesFile('doc/bounces')\n> +    for name, value in config.items('bounces'):\n> +        bounces.add(value)\n> +\n>      _UpdateDefaults(parser, config)\n>\n>  # These are the aliases we understand, indexed by alias. Each member is a list.\n>  alias = {}\n> +bounces = set()\n>\n>  if __name__ == \"__main__\":\n>      import doctest\n> --\n> 2.14.1\n>\n\nRegards,\nSimon","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"ip2Et/hl\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"QAk/FbhN\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjjCM2t0fz9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 23:00:15 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 1E416C21E2C; Thu, 31 Aug 2017 12:56:48 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 824F8C21E15;\n\tThu, 31 Aug 2017 12:55:48 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 88353C21E39; Thu, 31 Aug 2017 12:53:02 +0000 (UTC)","from mail-qk0-f179.google.com (mail-qk0-f179.google.com\n\t[209.85.220.179])\n\tby lists.denx.de (Postfix) with ESMTPS id 9F562C21E0D\n\tfor <u-boot@lists.denx.de>; Thu, 31 Aug 2017 12:52:58 +0000 (UTC)","by mail-qk0-f179.google.com with SMTP id l65so2324047qkc.0\n\tfor <u-boot@lists.denx.de>; Thu, 31 Aug 2017 05:52:58 -0700 (PDT)","by 10.200.28.106 with HTTP; Thu, 31 Aug 2017 05:52:36 -0700 (PDT)"],"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=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=coW4ZxYxqFatPYqu39EmI2afMVzI/IewWhuegFBFy3c=;\n\tb=ip2Et/hlEBPEgzHjffznp2wsn/j5H/KheHzj+0STNQSlEUQFgST3cRtZyneH5NGR8J\n\tYKpPqkppd8Qeza76ePxeCm9lgndoJw81FaVQvhTxunCBq0WjpsBOgj1MJZ9F39yvGJB5\n\tKyN51FyUGw8LcirHxG/8ULA1nQxWxphAXMT4zi48J6HtMjFwCQ9mfZy81HjZeVgmjy3p\n\t8cpBl/sJvdMwh5snInHxTxcvai0eU2cQi1KjGAiJfDiWd+251GVt8Ikbs/pFlJB+ujNe\n\tiXC0bJ56MW+jx68LIoNQhKRiS/nENy7OsOJIPFhSm3I611rgxbhA/DPUrBPizWoPTceX\n\tqyDw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=coW4ZxYxqFatPYqu39EmI2afMVzI/IewWhuegFBFy3c=;\n\tb=QAk/FbhNAvKwHdxEb9Z7kHYiw+7KPHbINvR13WzXHeC5PDuWvopQMJM5B+Zp8AgyFT\n\te5zeQUUXPGgvSZNQLJ9jd9MuLOtuMJZmbmkd6J67fqF1am2DokV5a7Q3jDAlvNTgORT5\n\tG5fRfKQ/kbQus1W4xE8bd8CkryVpEUUWubvo0="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=coW4ZxYxqFatPYqu39EmI2afMVzI/IewWhuegFBFy3c=;\n\tb=Va82bPYV0HyV/rQ1ZlBy5L1PLjsIeZ7osAZU8Eoo2JC5F90le3zmniDGbRWw8CnGN1\n\tCik7WdZ8Z6X7igvbtg5+DAFB9ddhptKIz7guFKi4wFqzaE3NLagdH/IWNdtTlRjnvRSW\n\t2XZhHRI2gv288mCC7Z72pDm2kGeieLQdFc8PHLo0pnhxEYUa7uaWKRI8LrJW15KPmsfg\n\t7IrtG8bnemns2gUEZbhL5vFd1ZcWLl4y3llOWuN3EnjY++xWWwsGlctgvydk7CUgxkDN\n\tbQCc4l/FzcL4tfh12suxu7rCSt2z3nl0IxhO4O/gXj4FMqBKfQsrUka2Du38yX9KuUTK\n\t5zWg==","X-Gm-Message-State":"AHPjjUgqfn+sb3rQ8o1jt9n0pCrb3wqHkwjOLeNXXATcwfAQzHNJBzE0\n\tfJmtzqDXxxqDXDRagMTK17YAIh82e/Jf","X-Google-Smtp-Source":"ADKCNb5YpCNcOBtOSxqiIrztGuF5D5C/fEq4cfzCjrWuO28QcueNCxfhee05A0kSCeMJqjgkuhWb0FSO42/vsMXinZk=","X-Received":"by 10.55.156.147 with SMTP id f141mr3497184qke.84.1504183977301; \n\tThu, 31 Aug 2017 05:52:57 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170829214852.22661-1-judge.packham@gmail.com>","References":"<20170829214852.22661-1-judge.packham@gmail.com>","From":"Simon Glass <sjg@chromium.org>","Date":"Thu, 31 Aug 2017 20:52:36 +0800","X-Google-Sender-Auth":"QUHn4LfnnYHNScNuIX6AvIsZ7Tw","Message-ID":"<CAPnjgZ1Gv90fG=hbSHYM2D1uUmqmP-wk3DJMg7EvJCWj2noMzw@mail.gmail.com>","To":"Chris Packham <judge.packham@gmail.com>","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH v2] patman: add support for omitting bouncing\n\taddresses","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]