mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Allen Hubbe <allenbh@gmail.com>
To: linux-kernel@vger.kernel.org, Andy Whitcroft <apw@canonical.com>,
	Joe Perches <joe@perches.com>
Cc: Allen Hubbe <allenbh@gmail.com>
Subject: [PATCH] checkpatch: check signoff when reading stdin
Date: Wed, 27 Jul 2016 19:05:04 -0400	[thread overview]
Message-ID: <5e6441a147be1d796620d1e302e1c73daa8c0b86.1469656370.git.allenbh@gmail.com> (raw)

Before, signoff was not checked if the filename is '-', indicating
reading the patch from stdin.  This causes commands such as below not to
warn about a missing signoff.

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

As a workaround, the command could be modified 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 '-' is special
for stdin, such as setting '$vname' to 'Your patch'.

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

This change causes checkpatch to check for a missing signoff line, even
if the filename is '-', as in the first variation of the command.

Signed-off-by: Allen Hubbe <allenbh@gmail.com>
---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 4904ced676d4..83acbac10705 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -6045,7 +6045,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 && $chk_signoff && $signoff == 0) {
 		ERROR("MISSING_SIGN_OFF",
 		      "Missing Signed-off-by: line(s)\n");
 	}
-- 
2.9.1

             reply	other threads:[~2016-07-27 23:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-27 23:05 Allen Hubbe [this message]
2016-07-28  0:41 ` Joe Perches
2016-07-29 14:45   ` Allen Hubbe
2016-07-29 15:38     ` Joe Perches
2016-07-28  1:53 ` [PATCH v2] " Allen Hubbe

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=5e6441a147be1d796620d1e302e1c73daa8c0b86.1469656370.git.allenbh@gmail.com \
    --to=allenbh@gmail.com \
    --cc=apw@canonical.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®