From patchwork Fri Aug 4 20:58:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chandan Somani X-Patchwork-Id: 1817169 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=2605:bc80:3010::133; helo=smtp2.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Iu+aiWVK; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [IPv6:2605:bc80:3010::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4RHdNl16Rwz1ydr for ; Sat, 5 Aug 2023 06:58:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 581ED408E2; Fri, 4 Aug 2023 20:58:45 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 581ED408E2 Authentication-Results: smtp2.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Iu+aiWVK X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9XxcceXzFibK; Fri, 4 Aug 2023 20:58:44 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp2.osuosl.org (Postfix) with ESMTPS id 638BA4064E; Fri, 4 Aug 2023 20:58:43 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 638BA4064E Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 3662EC0072; Fri, 4 Aug 2023 20:58:43 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) by lists.linuxfoundation.org (Postfix) with ESMTP id C9973C0032 for ; Fri, 4 Aug 2023 20:58:41 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9315041EEC for ; Fri, 4 Aug 2023 20:58:41 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 9315041EEC Authentication-Results: smtp4.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=Iu+aiWVK X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GrvyDGKfMA2w for ; Fri, 4 Aug 2023 20:58:40 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp4.osuosl.org (Postfix) with ESMTPS id A3F9B41B4F for ; Fri, 4 Aug 2023 20:58:40 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org A3F9B41B4F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691182719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=DAN3rxoey8d321lU3HLOyGC5cQ1ouGwWZOZfxlJ+2B4=; b=Iu+aiWVKtTb7+WFB9pfA7e+FpDVN916HJWuDDAbDgBTro/wxA/yeQndQMAEAYAqB1oU2rW NK0WKONLlthSzrFp+BYd8NUwws6cHku8aIYtZ1dEY/r1Y5qzm58lsjsVd1gzoQBqPvS83d tDGTznEJNthLP+i5e/ph/qs+87beizY= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-638-MgFEhVBjOTyBbansx4MwYg-1; Fri, 04 Aug 2023 16:58:38 -0400 X-MC-Unique: MgFEhVBjOTyBbansx4MwYg-1 Received: by mail-qt1-f200.google.com with SMTP id d75a77b69052e-40fd74104f3so4033941cf.0 for ; Fri, 04 Aug 2023 13:58:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691182717; x=1691787517; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=DAN3rxoey8d321lU3HLOyGC5cQ1ouGwWZOZfxlJ+2B4=; b=JmxoZDLmh6C3+Vd5wg4lPK9sbnCOor3r+RlMDo606BmrdCw3lKjcPWXqQgD+Pb6LXa 2dgs11Ze1NUI7NOGLme5WCpjdM+N77bWUP+v+EqHGNGHTMCaSnVofzsf4bODrcJ8q42x tzm8rHqXdV0ZF5Fv07ktcFh8cJMbeaJr0tJZz4uFT8kHLONMd9BUwk35HYQjxVwtW8bj nERM8bD5YkXGz1f0GYHxH4Tw4+bDsZNuapAZtWnX+7TqdZhQMazu3cRQD3UOp3Lp8NS4 +lw8JrwQanoQhvdDhsHzKWnB3m1RoJT+MIm54nhMQNd/9k3sOVF2GlrlnTaYbwJErnb2 rgRw== X-Gm-Message-State: ABy/qLbHPEOj1DSpg1MnMV2T8e4T9xRj0m0qcEGZlyoRtvPzZ1Sp/DYz v6QxbBSjx1bQRLc+Z6D5d7ygytnTRZTGOzuJ17j1IcQuF4iC8+xUSsOrhbZMgtuHKwgKASeOd3f os7h9tt7kgETgbJKDSEMzrXRZr0b/dxFSjxQPev1TpBO9l5IOj1b8BDAu21zQETkr4RPhV9E= X-Received: by 2002:ac8:7d90:0:b0:400:a9a4:8517 with SMTP id c16-20020ac87d90000000b00400a9a48517mr22652763qtd.4.1691182717689; Fri, 04 Aug 2023 13:58:37 -0700 (PDT) X-Google-Smtp-Source: APBJJlGUE5EKwCmR1F1aE0N7dSTdNv8/UtheqPO0IxmklgDP+bAcXLBYFQFENo895Xe6P7LiPYCZEg== X-Received: by 2002:ac8:7d90:0:b0:400:a9a4:8517 with SMTP id c16-20020ac87d90000000b00400a9a48517mr22652748qtd.4.1691182717341; Fri, 04 Aug 2023 13:58:37 -0700 (PDT) Received: from localhost.localdomain (47-147-45-48.lsan.ca.frontiernet.net. [47.147.45.48]) by smtp.gmail.com with ESMTPSA id a16-20020ac87210000000b00403f4459e33sm898475qtp.91.2023.08.04.13.58.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Aug 2023 13:58:36 -0700 (PDT) From: Chandan Somani To: dev@openvswitch.org Date: Fri, 4 Aug 2023 16:58:33 -0400 Message-Id: <20230804205834.2522-1-csomani@redhat.com> X-Mailer: git-send-email 2.26.3 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [ovs-dev] [PATCH 1/2] checkpatch: Enable subject checking on git-based patches. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" Subject spellcheck on git-based patches is now included in commands like utilities/checkpatch.py -S -2. Additionally, a block of code that is used to call ovs_checkpatch_parse() has been deleted since ovs_checkpatch_file() calls ovs_checkpatch_parse() anyways. This prevents duplicate WARNINGS and ERRORS from being printed. Signed-off-by: Chandan Somani --- utilities/checkpatch.py | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/utilities/checkpatch.py b/utilities/checkpatch.py index 5c4aaefb3..fd44bacf1 100755 --- a/utilities/checkpatch.py +++ b/utilities/checkpatch.py @@ -1111,30 +1111,9 @@ if __name__ == '__main__': colors = True if n_patches: - status = 0 - - git_log = 'git log --no-color --no-merges --pretty=format:"%H %s" ' - with os.popen(git_log + '-%d' % n_patches, 'r') as f: - commits = f.read().split("\n") - - for i in reversed(range(0, n_patches)): - revision, name = commits[i].split(" ", 1) - f = os.popen('''git format-patch -1 --stdout --pretty=format:"\ -Author: %an <%ae> -Commit: %cn <%ce> -Subject: %s - -%b" ''' + revision, 'r') - patch = f.read() - f.close() - - if not quiet: - print('== Checking %s ("%s") ==' % (revision[0:12], name)) - result = ovs_checkpatch_parse(patch, revision) - ovs_checkpatch_print_result() - if result: - status = EXIT_FAILURE - sys.exit(status) + patch_name = os.popen('git format-patch -' + str(n_patches)) + args = patch_name.read().strip().split('\n') + patch_name.close() if not args: if sys.stdin.isatty():