From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163649AbcG0XGB (ORCPT ); Wed, 27 Jul 2016 19:06:01 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:33956 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163133AbcG0XFv (ORCPT ); Wed, 27 Jul 2016 19:05:51 -0400 From: Allen Hubbe To: linux-kernel@vger.kernel.org, Andy Whitcroft , Joe Perches Cc: Allen Hubbe Subject: [PATCH] checkpatch: check signoff when reading stdin Date: Wed, 27 Jul 2016 19:05:04 -0400 Message-Id: <5e6441a147be1d796620d1e302e1c73daa8c0b86.1469656370.git.allenbh@gmail.com> X-Mailer: git-send-email 2.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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