+ checkpatch-check-signoff-when-reading-stdin.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: checkpatch: check signoff when reading stdin
has been added to the -mm tree.  Its filename is
     checkpatch-check-signoff-when-reading-stdin.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/checkpatch-check-signoff-when-reading-stdin.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/checkpatch-check-signoff-when-reading-stdin.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Allen Hubbe <allenbh@xxxxxxxxx>
Subject: checkpatch: check signoff when reading stdin

Signoff was not checked if the filename is '-', indicating reading the
patch from stdin.  Commands such as the below would not warn about a
missing signoff, because the patch filename is '-'.  This change allows
checkpatch to warn about a missing signoff, even if the input filename is
'-', but only if the patch has a commit message.

git show --pretty=email | scripts/checkpatch.pl -

A more common use of checkpatch with stdin is for piping git diff through
checkpatch.  The diff output would not contain a commit message, and
therefore it would not contain a signoff line.  For this common use case,
a warning should not be printed about the missing signoff.  With this
change we will only warn about a missing signoff if the input contains a
commit message.

git diff | scripts/checkpatch.pl -

Before this patch, a workaround for the first command was to refer to
stdin by a name other than '-'.  The workaround is not an elegant
solution, because elsewhere checkpatch uses the fact that filename equals
'-', such as in setting '$vname' to 'Your patch' for stdin.  The command
below would report "/dev/stdin has style problems" instead of "Your patch
has style problems."

git show --pretty=email | scripts/checkpatch.pl /dev/stdin

Link: http://lkml.kernel.org/r/48be31e414bddc65bccfa6b1322359be9ba032eb.1469670589.git.allenbh@xxxxxxxxx
Signed-off-by: Allen Hubbe <allenbh@xxxxxxxxx>
Cc: Andy Whitcroft <apw@xxxxxxxxxxxxx>
Cc: Joe Perches <joe@xxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 scripts/checkpatch.pl |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN scripts/checkpatch.pl~checkpatch-check-signoff-when-reading-stdin scripts/checkpatch.pl
--- a/scripts/checkpatch.pl~checkpatch-check-signoff-when-reading-stdin
+++ a/scripts/checkpatch.pl
@@ -2069,6 +2069,7 @@ sub process {
 	my $is_patch = 0;
 	my $in_header_lines = $file ? 0 : 1;
 	my $in_commit_log = 0;		#Scanning lines before patch
+	my $has_commit_log = 0;		#Encountered lines before patch
        my $commit_log_possible_stack_dump = 0;
 	my $commit_log_long_line = 0;
 	my $commit_log_has_diff = 0;
@@ -2566,6 +2567,7 @@ sub process {
 		      $rawline =~ /^(commit\b|from\b|[\w-]+:).*$/i)) {
 			$in_header_lines = 0;
 			$in_commit_log = 1;
+			$has_commit_log = 1;
 		}
 
 # Check if there is UTF-8 in a commit log when a mail header has explicitly
@@ -6055,7 +6057,7 @@ sub process {
 		ERROR("NOT_UNIFIED_DIFF",
 		      "Does not appear to be a unified-diff format patch\n");
 	}
-	if ($is_patch && $filename ne '-' && $chk_signoff && $signoff == 0) {
+	if ($is_patch && $has_commit_log && $chk_signoff && $signoff == 0) {
 		ERROR("MISSING_SIGN_OFF",
 		      "Missing Signed-off-by: line(s)\n");
 	}
_

Patches currently in -mm which might be from allenbh@xxxxxxxxx are

checkpatch-check-signoff-when-reading-stdin.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]
  Powered by Linux