From: Joe Perches <joe@perches.com>
To: Bruce Allan <bruce.w.allan@intel.com>
Cc: apw@canonical.com, linux-kernel@vger.kernel.org,
postmaster <postmaster@vger.kernel.org>
Subject: Re: [PATCH] checkpatch: warn when patch exceeds a maximum message size
Date: Thu, 05 Jun 2014 18:35:56 -0700 [thread overview]
Message-ID: <1402018556.3038.2.camel@joe-AO725> (raw)
In-Reply-To: <20140606000037.18356.720.stgit@gitlad.jf.intel.com>
On Thu, 2014-06-05 at 17:00 -0700, Bruce Allan wrote:
> the maximum message size (100,000 characters) allowed by Majordomo at
> vger.kernel.org since that is where most Linux email lists are served.
I believe this is incorrect and the patch is unnecessary.
It'd maybe more interesting if the email header sizes
were calculated and if > 1024, then some bleating message
were emitted.
> Also provide a command-line option to specify a different maximum size.
>
> Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
> ---
>
> scripts/checkpatch.pl | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 34eb216..79bd7fd6 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -40,6 +40,7 @@ my @ignore = ();
> my $help = 0;
> my $configuration_file = ".checkpatch.conf";
> my $max_line_length = 80;
> +my $max_msg_size = 100000; # Max allowed by Majordomo at vger.kernel.org
> my $ignore_perl_version = 0;
> my $minimum_perl_version = 5.10.0;
>
> @@ -62,6 +63,7 @@ Options:
> --types TYPE(,TYPE2...) show only these comma separated message types
> --ignore TYPE(,TYPE2...) ignore various comma separated message types
> --max-line-length=n set the maximum line length, if exceeded, warn
> + --max-msg-size=n set the maximum message size, if exceeded, warn
> --show-types show the message "types" in the output
> --root=PATH PATH to the kernel tree root
> --no-summary suppress the per-file summary
> @@ -130,6 +132,7 @@ GetOptions(
> 'types=s' => \@use,
> 'show-types!' => \$show_types,
> 'max-line-length=i' => \$max_line_length,
> + 'max-msg-size=i' => \$max_msg_size,
> 'root=s' => \$root,
> 'summary!' => \$summary,
> 'mailback!' => \$mailback,
> @@ -4600,6 +4603,18 @@ sub process {
> exit(0);
> }
>
> + # Warn if patch exceeds the maximum message size
> + if (!$file) {
> + my $cnt_chars = 0;
> + foreach my $rawline (@rawlines) {
> + $cnt_chars += length($rawline) + 1;
> + }
> + if ($cnt_chars > $max_msg_size) {
> + WARN("PATCH_TOO_LARGE",
> + "patch exceeds maximum message size ($max_msg_size) and might be blocked by email list server(s).\n");
> + }
> + }
> +
> if (!$is_patch) {
> ERROR("NOT_UNIFIED_DIFF",
> "Does not appear to be a unified-diff format patch\n");
>
next prev parent reply other threads:[~2014-06-06 1:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-06 0:00 [PATCH] checkpatch: warn when patch exceeds a maximum message size Bruce Allan
2014-06-06 1:35 ` Joe Perches [this message]
2014-06-06 15:08 ` Allan, Bruce W
2014-06-06 15:26 ` Joe Perches
2014-06-06 15:34 ` Joe Perches
2014-06-06 15:35 ` Allan, Bruce W
2014-06-06 15:45 ` Joe Perches
2014-06-06 15:51 ` Allan, Bruce W
2014-06-06 15:35 ` Allan, Bruce W
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1402018556.3038.2.camel@joe-AO725 \
--to=joe@perches.com \
--cc=apw@canonical.com \
--cc=bruce.w.allan@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=postmaster@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox