From patchwork Wed Sep 15 14:33:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 45049 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A9CC73857413 for ; Wed, 15 Sep 2021 14:34:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 914FF385840E for ; Wed, 15 Sep 2021 14:33:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 914FF385840E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 0FAFB22288 for ; Wed, 15 Sep 2021 14:33:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1631716431; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E4NyQ3meREZrP345Kv5FEGCwJnZyghyj6215Bl6eghI=; b=gcVSplU0Sjr9Ze4o085riPmJX4FSxn5yGaAYTvqQP9xtnG+f/0HM590M75ZJ+2CVV+RNcv Z3IIrATV+G9HZzoJze7bYbJ/c5MRl/MMHa0K4hFKnr97iTmlQhFmVMEi1AAB1H81VgxBWj Ig5fMJioqrpe7Drj0o09q9eJtCqhq5E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1631716431; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=E4NyQ3meREZrP345Kv5FEGCwJnZyghyj6215Bl6eghI=; b=eLuSuQdnu4jcCquPRQyFY+xrrnC2aFq9fQjf5mmlTVVX8jp0gsz/CJCc5ykXEoUnELlQ9e /QD7Oo96jT6524AQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F018413C5A for ; Wed, 15 Sep 2021 14:33:50 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id oP+hOU4EQmG/BQAAMHmgww (envelope-from ) for ; Wed, 15 Sep 2021 14:33:50 +0000 Message-ID: <647eb68e-ba6c-b9f0-860f-6e51ec248494@suse.cz> Date: Wed, 15 Sep 2021 16:33:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH][pushed] gcc-changelog: check git commit email address To: gcc-patches@gcc.gnu.org Content-Language: en-US X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, CTE_8BIT_MISMATCH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" contrib/ChangeLog: * gcc-changelog/git_commit.py: Check commit email. * gcc-changelog/test_email.py: Add new test. * gcc-changelog/test_patches.txt: Likewise. --- contrib/gcc-changelog/git_commit.py | 10 ++++++++++ contrib/gcc-changelog/test_email.py | 5 +++++ contrib/gcc-changelog/test_patches.txt | 25 +++++++++++++++++++++++++ 3 files changed, 40 insertions(+) diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py index d1646bdc0cd..03736140fd0 100755 --- a/contrib/gcc-changelog/git_commit.py +++ b/contrib/gcc-changelog/git_commit.py @@ -326,6 +326,8 @@ class GitCommit: if not self.info: return + self.check_commit_email() + # Extract PR numbers form the subject line # Match either [PRnnnn] / (PRnnnn) or PR component/nnnn if self.info.lines and not self.revert_commit: @@ -803,3 +805,11 @@ class GitCommit: print('Errors:') for error in self.errors: print(error) + + def check_commit_email(self): + # Parse 'Martin Liska ' + email = self.info.author.split(' ')[-1].strip('<>') + + # Verify that all characters are ASCII + if len(email) != len(email.encode()): + self.errors.append(Error(f'non-ASCII characters in git commit email address ({email})')) diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py index 319e065ca55..dae7c27c707 100755 --- a/contrib/gcc-changelog/test_email.py +++ b/contrib/gcc-changelog/test_email.py @@ -440,3 +440,8 @@ class TestGccChangelog(unittest.TestCase): def test_copyright_years(self): email = self.from_patch_glob('copyright-years.patch') assert not email.errors + + def test_non_ascii_email(self): + email = self.from_patch_glob('non-ascii-email.patch') + assert (email.errors[0].message == + 'non-ASCII characters in git commit email address (jbglaw@ług-owl.de)') diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt index ba516274fc1..98a0d3f1ee0 100644 --- a/contrib/gcc-changelog/test_patches.txt +++ b/contrib/gcc-changelog/test_patches.txt @@ -3464,3 +3464,28 @@ index 6f67552d075..32478f070e8 100644 + -- 2.25.1 + +=== non-ascii-email.patch === +From f42e95a830ab48e59389065ce79a013a519646f1 Mon Sep 17 00:00:00 2001 +From: Jan-Benedict Glaw +Date: Mon, 13 Sep 2021 12:08:25 +0200 +Subject: [PATCH] Fix multi-statment macro + +INIT_CUMULATIVE_ARGS() expands to multiple statements, which will break right +after an `if` statement. Wrap it into a block. + +gcc/ChangeLog: + + * config/alpha/vms.h (INIT_CUMULATIVE_ARGS): Wrap multi-statment + define into a block. +--- + gcc/config/alpha/vms.h | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h +index 2a9917cde62..0033b0004b3 100644 +--- a/gcc/config/alpha/vms.h ++++ b/gcc/config/alpha/vms.h +@@ -0,0 +1,1 @@ ++ +--