public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Patch] contrib/gcc-changelog: Detect if same file appears twice
@ 2021-05-07 10:39 Tobias Burnus
  2021-05-10 10:45 ` Martin Liška
  0 siblings, 1 reply; 2+ messages in thread
From: Tobias Burnus @ 2021-05-07 10:39 UTC (permalink / raw)
  To: Martin Liška, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 243 bytes --]

Test for a copyed-but-not-fully-edited error.

OK?

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf

[-- Attachment #2: check-log-same.diff --]
[-- Type: text/x-patch, Size: 3451 bytes --]

contrib/gcc-changelog: Detect if same file appears twice

contrib/ChangeLog:

	* gcc-changelog/git_commit.py (Error.__repr__): Add space after the colon.
	(GitCommit.check_mentioned_files): Check whether the same file has been
	specified multiple times.
	* gcc-changelog/test_email.py (TestGccChangelog.test_multi_same_file): New.
	* gcc-changelog/test_patches.txt (0001-OpenMP-Fix-SIMT): New test.

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index b28f7deac23..d9332cb0c38 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -200,7 +200,7 @@ class Error:
     def __repr__(self):
         s = self.message
         if self.line:
-            s += ':"%s"' % self.line
+            s += ': "%s"' % self.line
         return s
 
 
@@ -629,7 +629,12 @@ class GitCommit:
             assert not entry.folder.endswith('/')
             for file in entry.files:
                 if not self.is_changelog_filename(file):
-                    mentioned_files.add(os.path.join(entry.folder, file))
+                    item = os.path.join(entry.folder, file)
+                    if item in mentioned_files:
+                        msg = 'same file specified multiple times'
+                        self.errors.append(Error(msg, file))
+                    else:
+                        mentioned_files.add(item)
             for pattern in entry.file_patterns:
                 mentioned_patterns.append(os.path.join(entry.folder, pattern))
 
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index 8abf5c37487..d66bf5be4eb 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -424,3 +424,7 @@ class TestGccChangelog(unittest.TestCase):
     def test_long_filenames(self):
         email = self.from_patch_glob('0001-long-filenames')
         assert not email.errors
+
+    def test_multi_same_file(self):
+        email = self.from_patch_glob('0001-OpenMP-Fix-SIMT')
+        assert email.errors[0].message == 'same file specified multiple times'
diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt
index 3f9806dc076..7e4a4b01081 100644
--- a/contrib/gcc-changelog/test_patches.txt
+++ b/contrib/gcc-changelog/test_patches.txt
@@ -3546,3 +3546,32 @@ index 5ad82db1def..53b15f32516 100644
 @@ -1 +1,2 @@
  
 +
+
+=== 0001-OpenMP-Fix-SIMT ===
+From 33b647956caa977d1ae489f9baed9cef70b4f382 Mon Sep 17 00:00:00 2001
+From: Tobias Burnus <tobias@codesourcery.com>
+Date: Fri, 7 May 2021 12:11:51 +0200
+Subject: [PATCH] OpenMP: Fix SIMT for complex/float reduction with && and ||
+
+libgomp/ChangeLog:
+
+	* testsuite/libgomp.c-c++-common/reduction-5.c: New test, testing
+	complex/floating-point || + && reduction with 'omp target'.
+	* testsuite/libgomp.c-c++-common/reduction-5.c: Likewise.
+---
+diff --git a/libgomp/testsuite/libgomp.c-c++-common/reduction-5.c b/libgomp/testsuite/libgomp.c-c++-common/reduction-5.c
+new file mode 100644
+index 00000000000..21540512e23
+--- /dev/null
++++ b/libgomp/testsuite/libgomp.c-c++-common/reduction-5.c
+@@ -0,0 +1,1 @@
++
+diff --git a/libgomp/testsuite/libgomp.c-c++-common/reduction-6.c b/libgomp/testsuite/libgomp.c-c++-common/reduction-6.c
+new file mode 100644
+index 00000000000..21540512e23
+--- /dev/null
++++ b/libgomp/testsuite/libgomp.c-c++-common/reduction-6.c
+@@ -0,0 +1,1 @@
++
+-- 
+2.25.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Patch] contrib/gcc-changelog: Detect if same file appears twice
  2021-05-07 10:39 [Patch] contrib/gcc-changelog: Detect if same file appears twice Tobias Burnus
@ 2021-05-10 10:45 ` Martin Liška
  0 siblings, 0 replies; 2+ messages in thread
From: Martin Liška @ 2021-05-10 10:45 UTC (permalink / raw)
  To: Tobias Burnus, gcc-patches

On 5/7/21 12:39 PM, Tobias Burnus wrote:
> Test for a copyed-but-not-fully-edited error.
> 
> OK?

Yes, please install it.

Thanks,
Martin

> 
> Tobias
> 
> -----------------
> Mentor Graphics (Deutschland) GmbH, Arnulfstrasse 201, 80634 München Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Frank Thürauf


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-10 10:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-07 10:39 [Patch] contrib/gcc-changelog: Detect if same file appears twice Tobias Burnus
2021-05-10 10:45 ` Martin Liška

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).