From patchwork Sat May 26 23:10:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 921019 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; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Le5GH/d5"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 40tf4B1Prhz9s0t for ; Sun, 27 May 2018 09:10:49 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id A55C2C21D65; Sat, 26 May 2018 23:10:42 +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_BLOCKED, 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 844E4C21D65; Sat, 26 May 2018 23:10:39 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B4600C21D65; Sat, 26 May 2018 23:10:38 +0000 (UTC) Received: from mail-pf0-f169.google.com (mail-pf0-f169.google.com [209.85.192.169]) by lists.denx.de (Postfix) with ESMTPS id 0F9E2C21C3F for ; Sat, 26 May 2018 23:10:38 +0000 (UTC) Received: by mail-pf0-f169.google.com with SMTP id a22-v6so4163789pfn.6 for ; Sat, 26 May 2018 16:10:37 -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=Qkpn76yyusPwA5JtpREz9kppoNA6fVu+ujeh51rdb7c=; b=Le5GH/d5wBSy6xo2VvM80TQSERZqkHCFAwZ2jreOuOFph40dCUOU3k0t9nb5m5OVOX pKPKnh9bAlxuBJdwa6TvhnLyWALZmvTr08bQc268LUqY48+o5dWHAq+dKOgWgn7YeYHh fsCfvc+CWjGLo1DVqxCrGQynQOGeMKA+50GP0k/mW19M5rXkhj7obedhq9aQZt9TZq4q 5t+d+VKDT/d5tEwaz3j8DB8+CU/dXNjI2sHtjFc+YfiOrQSO1SUoozIVS+FPckR7VF6b jOrtEgKX+yJU7x+o96D2vnTO9vN/QwCTv6hrJQgZqp47DWW8Hz8DzUC4LlIZObU7i93I zWPA== 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=Qkpn76yyusPwA5JtpREz9kppoNA6fVu+ujeh51rdb7c=; b=DTcLA8pr0MzxH+blwg7usMj1BGLtooDPyaGlCy4eMKZxddcZYxqh/CN0ASXcfL91Bv 4VBYIyQXZQKrj+CHqNZhjxmhHUvFr5ToxgTTqtXUlGFEPc8I+ZfUTc4qohxaceyprsTj O8X8XhPuYYvugj5rN0ZTKMMQtMLKliUCDnkxmJ97I2C84f3inlhYSpla1JY0WhFEOX6B DWcIT3MU24pGd8FdUkQ1EgGkn4j+9WC3J+Y8vjuEjcs/6qmtckQmEJ2aAmT3GAEhWkE9 zSWhfOaxmwJAR0KCf5aUiWGpipkCz2RzwbdYifMvfPUZFahBNJfiWoclKhcMavxug4xq oeVA== X-Gm-Message-State: ALKqPwcPrcBmcCIFgfzxGJ6IbmOFwGG9rdyNoRESd95epkv9+kL9CoXg XajXpFqpm8CNW4RSb4RbeXVutYaASFg= X-Google-Smtp-Source: AB8JxZrA+Kd/rpqNdEMSCcuua2mbTuTga5Z6FdHGWOfJgulRSOIZPatBeTzfdGZtKOXtUqCx/RC5uQ== X-Received: by 2002:a63:64c5:: with SMTP id y188-v6mr6277889pgb.37.1527376236415; Sat, 26 May 2018 16:10:36 -0700 (PDT) Received: from chrisp-dl.ws.atlnz.lc ([2001:df5:b000:22:3a2c:4aff:fe70:2b02]) by smtp.gmail.com with ESMTPSA id 76-v6sm63784813pfm.178.2018.05.26.16.10.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 26 May 2018 16:10:35 -0700 (PDT) From: Chris Packham To: u-boot@lists.denx.de Date: Sun, 27 May 2018 11:10:27 +1200 Message-Id: <20180526231027.18621-1-judge.packham@gmail.com> X-Mailer: git-send-email 2.17.0 Cc: Chris Packham Subject: [U-Boot] [PATCH] patman: add option for limiting the Cc list 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" Many mailing-lists consider a long Cc list a sign of spam and will either drop the message or mark it for moderation. Because patman automatically invokes get_maintainer.pl the Cc list can expand unexpectedly. Allow the user to specify a limit for the Cc list. This limit is applied after removing any known bouncing addresses. By default no limit is applied. Signed-off-by: Chris Packham --- I've fallen foul of the u-boot ML Cc limit a few times recently. I'm not sure what the actual limit is so I've left patman's default behaviour unlimited. tools/patman/patman.py | 4 +++- tools/patman/series.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/patman/patman.py b/tools/patman/patman.py index 8d2c78235a7e..7dd7a1c7b61a 100755 --- a/tools/patman/patman.py +++ b/tools/patman/patman.py @@ -38,6 +38,8 @@ parser.add_option('-i', '--ignore-errors', action='store_true', parser.add_option('-m', '--no-maintainers', action='store_false', dest='add_maintainers', default=True, help="Don't cc the file maintainers automatically") +parser.add_option('-l', '--limit-cc', dest='limit', type='int', + default=0, help='Limit the cc list to LIMIT entries [default: %default]') parser.add_option('-n', '--dry-run', action='store_true', dest='dry_run', default=False, help="Do a dry run (create but don't email patches)") parser.add_option('-p', '--project', default=project.DetectProject(), @@ -157,7 +159,7 @@ else: cc_file = series.MakeCcFile(options.process_tags, cover_fname, not options.ignore_bad_tags, - options.add_maintainers) + options.add_maintainers, options.limit) # Email the patches out (giving the user time to check / cancel) cmd = '' diff --git a/tools/patman/series.py b/tools/patman/series.py index d526d4ee91d3..2066b97e73ff 100644 --- a/tools/patman/series.py +++ b/tools/patman/series.py @@ -202,7 +202,7 @@ class Series(dict): print(col.Color(col.RED, str)) def MakeCcFile(self, process_tags, cover_fname, raise_on_error, - add_maintainers): + add_maintainers, limit=0): """Make a cc file for us to use for per-commit Cc automation Also stores in self._generated_cc to make ShowActions() faster. @@ -238,6 +238,8 @@ class Series(dict): print(col.Color(col.YELLOW, 'Skipping "%s"' % x)) cc = set(cc) - set(settings.bounces) cc = [m.encode('utf-8') if type(m) != str else m for m in cc] + if limit > 0: + cc = cc[:limit] all_ccs += cc print(commit.patch, ', '.join(set(cc)), file=fd) self._generated_cc[commit.patch] = cc