From nobody Thu Apr 25 20:31:12 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=patchew-devel-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=patchew-devel-bounces@redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1523008302398545.827925669811; Fri, 6 Apr 2018 02:51:42 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1A316811A7; Fri, 6 Apr 2018 09:51:41 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 091545D9C6; Fri, 6 Apr 2018 09:51:41 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E8095180005A; Fri, 6 Apr 2018 09:51:40 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w369pd6B009065 for ; Fri, 6 Apr 2018 05:51:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id E91AE2023235; Fri, 6 Apr 2018 09:51:38 +0000 (UTC) Received: from donizetti.redhat.com (ovpn-117-39.ams2.redhat.com [10.36.117.39]) by smtp.corp.redhat.com (Postfix) with ESMTP id 51C162023227 for ; Fri, 6 Apr 2018 09:51:38 +0000 (UTC) From: Paolo Bonzini To: patchew-devel@redhat.com Date: Fri, 6 Apr 2018 11:51:36 +0200 Message-Id: <20180406095136.15083-2-pbonzini@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-loop: patchew-devel@redhat.com Subject: [Patchew-devel] [PATCH] series-diff: tweak replacement of ignored text X-BeenThere: patchew-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Patchew development and discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: patchew-devel-bounces@redhat.com Errors-To: patchew-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 06 Apr 2018 09:51:41 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Sometimes the "@@" lines end without a function name. In that case there i= s no space after the second "@@". Tweak the regular expression to cover that ca= se, checking for end-of-line as an alternative to the space. For consistency, anchor the regexes to the beginning of the line as well. --- mods/diff.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mods/diff.py b/mods/diff.py index 197e31e..4896f41 100644 --- a/mods/diff.py +++ b/mods/diff.py @@ -77,10 +77,10 @@ class DiffModule(PatchewModule): filtered =3D "" sep =3D "" for l in m.get_body().splitlines(): - for pat, repl in [(r"index [0-9a-f]+\.\.[0-9a-f]+", + for pat, repl in [(r"^index [0-9a-f]+\.\.[0-9a-f]+", r"index XXXXXXX..XXXXXXX"), - (r"@@ -[0-9]+,[0-9]+ \+[0-9]+,[0-9]+ @@ = ", - r"@@ -XXX,XX +XXX,XX @@ ")]: + (r"^@@ -[0-9]+,[0-9]+ \+[0-9]+,[0-9]+ @= @( |$)", + r"@@ -XXX,XX +XXX,XX @@\1")]: l =3D re.sub(pat, repl, l) filtered +=3D sep + l sep =3D "\n" --=20 2.16.2 _______________________________________________ Patchew-devel mailing list Patchew-devel@redhat.com https://www.redhat.com/mailman/listinfo/patchew-devel