Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1120242imm; Wed, 25 Jul 2018 11:51:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeQn10aAMf4KjT5IZHVOquF3QCg02WoEMPFahjCEx1nALP/Vc7FYBLV7Ev+N3VQYNnsQqeD X-Received: by 2002:a17:902:42c3:: with SMTP id h61-v6mr21974384pld.319.1532544668359; Wed, 25 Jul 2018 11:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532544668; cv=none; d=google.com; s=arc-20160816; b=FQ6mbTi2xPdopgzULHHKWbqOqFWfoBlELJybUo5Z7OfkjGm0SuCQCBW57H08NR4Y+J P8moX/wgZyt2laOdj/9uCu7AfrXA3i4k8AGeYWUKYb5DdMy6hyUlzXlHKSBSo8WMQPwo aUWkkDpiuVSHY5AUi+vBKRvzFmCaMFU4qRAtVJTMGQXEaz9ywXwWxrEzCwkU6thow4Sh SGHOxyJh9ZwPm6KpMl9u0CXmRdgsukUcQ7F9aWR4qpUYFjabWxIf9GrnXJH6hVm/Vg8/ py23K7OJwzMnb3uq4YloSMbafvWcp2RsO/NVVLd/9tPjH1f/bkn+d2sirLecOJ25zzHG /6HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=s0wGRH3AdPaA9jzgq3ufJ7g1ZRF297NA1UHZr8msuls=; b=NvLgcG9PNZS93NkFjkPHyOcDkoTZ7o+Rc4jh1V6cdgRLR2L8QI4O27E/XV9y0cVxri EEgyamVx7PX9imwQwGFF5goNU/2R/4DlO7Cvd0cgkSquMcuIAAAZlN84+E0I8nLaVXjU PjiXZTLUIAyf4xn9ySOajVxql4b+vyrlCMDEAa26z58O35TgJvsZBlyVg/N7g1Y9S0hO HQ/C5XGcFc68O9mvLuPO2OeSdBFRN7cmk71exRtSVM+PpjyrHy7CCkw9GIsb69Gc4wvE NUUfTZ5Ji4T1BvxWD5as/zKs7DElBIfjwT/emsXnxtdsi4AKqSVvoEYdvbA/OIW0GV1v lhwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=DcjPM2sY; dkim=pass header.i=@codeaurora.org header.s=default header.b=S+xIcORY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g2-v6si14820216pgg.83.2018.07.25.11.50.53; Wed, 25 Jul 2018 11:51:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=DcjPM2sY; dkim=pass header.i=@codeaurora.org header.s=default header.b=S+xIcORY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731167AbeGYUCh (ORCPT + 99 others); Wed, 25 Jul 2018 16:02:37 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57304 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729170AbeGYUCh (ORCPT ); Wed, 25 Jul 2018 16:02:37 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9B7CC605BD; Wed, 25 Jul 2018 18:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532544580; bh=hqcVmCp7ExcjrQLAmHsgJU9CiWMSsU4oBFtN211aU7I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DcjPM2sYVDKELq8R8a0TI18qyEMM65/9s6SnbFPiXsihIngb/4XBhc8JbMUqWgdVe AwL4IlrQjTqRKnX5qgRHsidHj9GzPXu1Hya4sJyuvgerPlKJdnUcx2EEqLE1vg1VEg khm2IZl8f/qTuAcv5f+9UI42B6luwpxwzhaLTVWI= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 8A4CC605BD; Wed, 25 Jul 2018 18:49:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1532544579; bh=hqcVmCp7ExcjrQLAmHsgJU9CiWMSsU4oBFtN211aU7I=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S+xIcORYiOV1giBQ1shtgQfdHPpj7V878vrm26ttEyGOq38gIzwztIoLyErRCOyj6 6TpJQMXepEeYg2Wd/G4sSrcNcSjknQgZSbCtTVUZtSa5w3BMAyf1qW1+4mKt3iSTwM aeUFnkLMlCUDWEcIf3wFjqza/zqZ7VDn6HVASIL4= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 25 Jul 2018 11:49:39 -0700 From: pheragu@codeaurora.org To: Joe Perches Cc: Andrew Morton , Greg KH , apw@canonical.com, linux-kernel@vger.kernel.org, tsoni@codeaurora.org, bryanh@codeaurora.org, ckadabi@codeaurora.org, David Keitel Subject: Re: [PATCH] checkpatch: Require commit text and warn on long commit text lines In-Reply-To: <59a1b82fd854c9bf8a530bb053b718dc@codeaurora.org> References: <1531518027-13318-1-git-send-email-pheragu@codeaurora.org> <6799952fbd3639c764c112bde961b5e00270a52d.camel@perches.com> <6ed46f85a7577e1d4a48e81f67fd7581@codeaurora.org> <50a05aaf44e5f86cbf687863dadaa26b45debe2d.camel@perches.com> <59a1b82fd854c9bf8a530bb053b718dc@codeaurora.org> Message-ID: <387ec7f1d900b3de28f3bbf82d36bf8a@codeaurora.org> X-Sender: pheragu@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-07-16 11:20, pheragu@codeaurora.org wrote: > On 2018-07-13 17:08, Joe Perches wrote: >> On Fri, 2018-07-13 at 16:28 -0700, pheragu@codeaurora.org wrote: >>> On 2018-07-13 14:46, Joe Perches wrote: >>> > On Fri, 2018-07-13 at 14:40 -0700, Prakruthi Deepak Heragu wrote: >>> > > Commit text is almost always necessary to explain why a change is >>> > > needed. >>> > >>> > This bit seems sensible, but perhaps it should just count the >>> > number of lines after the end of email headers and before any >>> > Signed-off-by:/Signature line >>> > >>> >>> While committing the changes, one can just write the subject and not >>> write >>> the commit text at all. So, if we just count the lines between email >>> headers >>> and signed-off, we still do count lines which form the subject, but >>> the >>> commit text is still absent. Also, subject can be longer than one >>> line. >>> So, >>> just counting lines doesn't really guarantee the presence of commit >>> text. >> >> Not true. >> Look at $in_header_lines and $in_commit_log. >> >>> > > Also, warn on commit text lines longer than 75 characters. The commit >>> > > text >>> > > are indented and may wrap on a terminal if they are longer than 75 >>> > > characters. >>> > >>> > This is already exists via >>> > >>> > # Check for line lengths > 75 in commit log, warn once >>> > if ($in_commit_log && !$commit_log_long_line && >>> > length($line) > 75 && >>> > >>> >>> True, but this patch points out every line of the commit text that is >>> exceeding the limit. >> >> Which is bad because things like dump_stack() are added in >> commit logs and those are already allowed to be > 75 chars. >> >> Anyway, something like this probably works. Please test. >> --- >> scripts/checkpatch.pl | 13 +++++++++++++ >> 1 file changed, 13 insertions(+) >> >> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl >> index b5c875d7132b..8b5f3dae31c9 100755 >> --- a/scripts/checkpatch.pl >> +++ b/scripts/checkpatch.pl >> @@ -2240,6 +2240,7 @@ sub process { >> 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_lines = 0; #Number of commit log lines >> my $commit_log_possible_stack_dump = 0; >> my $commit_log_long_line = 0; >> my $commit_log_has_diff = 0; >> @@ -2497,6 +2498,18 @@ sub process { >> >> $cnt_lines++ if ($realcnt != 0); >> >> +# Verify the existence of a commit log if appropriate >> +# 2 is used because a $signature is counted in $commit_log_lines >> + if ($in_commit_log) { >> + if ($line !~ /^\s*$/) { >> + $commit_log_lines++; #could be a $signature >> + } >> + } else if ($has_commit_log && $commit_log_lines < 2) { >> + WARN("COMMIT_MESSAGE", >> + "Missing commit description - Add an appropriate one\n"); >> + $commit_log_lines = 2; #warn only once >> + } >> + >> # Check if the commit log has what seems like a diff which can >> confuse patch >> if ($in_commit_log && !$commit_log_has_diff && >> (($line =~ m@^\s+diff\b.*a/[\w/]+@ && > I checked all the cases that I mentioned before. The change you > suggested works > for every case. Would you take care of merging this fix? Any updates on this patch? Would you take care of merging this fix?