From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69B8AC4363A for ; Fri, 30 Oct 2020 12:10:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1ABCF2076E for ; Fri, 30 Oct 2020 12:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726325AbgJ3MKN (ORCPT ); Fri, 30 Oct 2020 08:10:13 -0400 Received: from smtprelay0084.hostedemail.com ([216.40.44.84]:52220 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725922AbgJ3MKM (ORCPT ); Fri, 30 Oct 2020 08:10:12 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 94D22180286DE; Fri, 30 Oct 2020 12:10:11 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: turn44_2e084d327295 X-Filterd-Recvd-Size: 2361 Received: from XPS-9350.home (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf06.hostedemail.com (Postfix) with ESMTPA; Fri, 30 Oct 2020 12:10:10 +0000 (UTC) Message-ID: <926a2f22e12bf989d46dc36c8779c50183bf4b7e.camel@perches.com> Subject: Re: [PATCH] checkpatch: add fix option for GERRIT_CHANGE_ID From: Joe Perches To: Aditya Srivastava Cc: linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, lukas.bulwahn@gmail.com, Andrew Morton Date: Fri, 30 Oct 2020 05:10:09 -0700 In-Reply-To: <20201030114447.24199-1-yashsri421@gmail.com> References: <20201030114447.24199-1-yashsri421@gmail.com> Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-10-30 at 17:14 +0530, Aditya Srivastava wrote: > Currently, whenever a Gerrit Change-Id is present in a commit, > checkpatch.pl warns to remove the Change-Id before submitting the patch. > > E.g., running checkpatch on commit adc311a5bbf6 ("iwlwifi: bump FW > API to 53 for 22000 series") reports this error: > > ERROR: Remove Gerrit Change-Id's before submitting upstream > Change-Id: I5725e46394f3f53c3069723fd513cc53c7df383d > > Provide a simple fix option by simply deleting the indicated line. [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl [] > @@ -2852,8 +2852,11 @@ sub process { >   > >  # Check for Gerrit Change-Ids not in any patch context >   if ($realfile eq '' && !$has_patch_separator && $line =~ /^\s*change-id:/i) { > - ERROR("GERRIT_CHANGE_ID", > - "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr); > + if (ERROR("GERRIT_CHANGE_ID", > + "Remove Gerrit Change-Id's before submitting upstream\n" . $herecurr) && > + $fix) { > + fix_delete_line($fixlinenr, $rawline); > + } >   } Seems sensible, thanks. It might also be sensible if the line before and the line after this change-id is also blank to remove one of those blank lines. On second thought: A quick check shows less than 20 of those in kernel git history so it might not be too worthwhile. Acked-by: Joe Perches