mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-25 02:25:31 +08:00
gcc-changelog: Be stricter for top-level dir.
contrib/ChangeLog: * gcc-changelog/git_commit.py: New files in toplev must be explicitly marked as "New file". * gcc-changelog/test_email.py: Test. * gcc-changelog/test_patches.txt: Add test.
This commit is contained in:
parent
f1af8528d3
commit
978abe918f
@ -718,9 +718,15 @@ class GitCommit:
|
|||||||
self.changelog_entries.append(entry)
|
self.changelog_entries.append(entry)
|
||||||
# strip prefix of the file
|
# strip prefix of the file
|
||||||
assert file.startswith(entry.folder)
|
assert file.startswith(entry.folder)
|
||||||
file = file[len(entry.folder):].lstrip('/')
|
# do not allow auto-addition of New files
|
||||||
entry.lines.append('\t* %s: New file.' % file)
|
# for the top-level folder
|
||||||
entry.files.append(file)
|
if entry.folder:
|
||||||
|
file = file[len(entry.folder):].lstrip('/')
|
||||||
|
entry.lines.append('\t* %s: New file.' % file)
|
||||||
|
entry.files.append(file)
|
||||||
|
else:
|
||||||
|
msg = 'new file in the top-level folder not mentioned in a ChangeLog'
|
||||||
|
self.errors.append(Error(msg, file))
|
||||||
else:
|
else:
|
||||||
used_pattern = [p for p in mentioned_patterns
|
used_pattern = [p for p in mentioned_patterns
|
||||||
if file.startswith(p)]
|
if file.startswith(p)]
|
||||||
|
@ -446,3 +446,8 @@ class TestGccChangelog(unittest.TestCase):
|
|||||||
email = self.from_patch_glob('non-ascii-email.patch')
|
email = self.from_patch_glob('non-ascii-email.patch')
|
||||||
assert (email.errors[0].message ==
|
assert (email.errors[0].message ==
|
||||||
'non-ASCII characters in git commit email address (jbglaw@ług-owl.de)')
|
'non-ASCII characters in git commit email address (jbglaw@ług-owl.de)')
|
||||||
|
|
||||||
|
def test_new_file_in_root_folder(self):
|
||||||
|
email = self.from_patch_glob('toplev-new-file.patch')
|
||||||
|
assert (email.errors[0].message ==
|
||||||
|
'new file in the top-level folder not mentioned in a ChangeLog')
|
||||||
|
@ -3489,3 +3489,85 @@ index 2a9917cde62..0033b0004b3 100644
|
|||||||
@@ -0,0 +1,1 @@
|
@@ -0,0 +1,1 @@
|
||||||
+
|
+
|
||||||
--
|
--
|
||||||
|
|
||||||
|
=== toplev-new-file.patch ===
|
||||||
|
From 05e37b6e65027188f08e6374c7d356d75b54738e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martin Liska <mliska@suse.cz>
|
||||||
|
Date: Mon, 24 Jan 2022 12:46:27 +0100
|
||||||
|
Subject: [PATCH] New file.
|
||||||
|
|
||||||
|
ChangeLog:
|
||||||
|
|
||||||
|
* Makefile.in: Update.
|
||||||
|
|
||||||
|
gcc/ChangeLog:
|
||||||
|
|
||||||
|
* ipa-icf.cc: Update.
|
||||||
|
---
|
||||||
|
Makefile.am | 1 +
|
||||||
|
Makefile.in | 1 +
|
||||||
|
gcc/ipa-icf.cc | 1 +
|
||||||
|
gcc/ipa-icf2.cc | 1 +
|
||||||
|
4 files changed, 4 insertions(+)
|
||||||
|
create mode 100644 Makefile.am
|
||||||
|
create mode 100644 gcc/ipa-icf2.cc
|
||||||
|
|
||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..f0129caae3d
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+new file.
|
||||||
|
diff --git a/Makefile.in b/Makefile.in
|
||||||
|
index 79c77fccf0f..7a090030119 100644
|
||||||
|
--- a/Makefile.in
|
||||||
|
+++ b/Makefile.in
|
||||||
|
@@ -1,4 +1,5 @@
|
||||||
|
|
||||||
|
+
|
||||||
|
# Makefile.in is generated from Makefile.tpl by 'autogen Makefile.def'.
|
||||||
|
#
|
||||||
|
# Makefile for directory with subdirs to build.
|
||||||
|
diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc
|
||||||
|
index 765ae746745..15735b6684f 100644
|
||||||
|
--- a/gcc/ipa-icf.cc
|
||||||
|
+++ b/gcc/ipa-icf.cc
|
||||||
|
@@ -1,3 +1,4 @@
|
||||||
|
+
|
||||||
|
/* Interprocedural Identical Code Folding pass
|
||||||
|
Copyright (C) 2014-2022 Free Software Foundation, Inc.
|
||||||
|
|
||||||
|
diff --git a/gcc/ipa-icf2.cc b/gcc/ipa-icf2.cc
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..c49c556e0e4
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/gcc/ipa-icf2.cc
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+tt
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
|
||||||
|
From 80c9d63af350b280bfccb82adb3867c25a25e6d0 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Martin Liska <mliska@suse.cz>
|
||||||
|
Date: Mon, 24 Jan 2022 12:17:09 +0100
|
||||||
|
Subject: [PATCH] Add Makefile.am file.
|
||||||
|
|
||||||
|
Foo bar.
|
||||||
|
|
||||||
|
ChangeLog:
|
||||||
|
|
||||||
|
---
|
||||||
|
Makefile.am | 0
|
||||||
|
1 file changed, 0 insertions(+), 0 deletions(-)
|
||||||
|
create mode 100644 Makefile.am
|
||||||
|
|
||||||
|
diff --git a/Makefile.am b/Makefile.am
|
||||||
|
new file mode 100644
|
||||||
|
index 00000000000..d6459e00543
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/Makefile.am
|
||||||
|
@@ -0,0 +1 @@
|
||||||
|
+xxx
|
||||||
|
--
|
||||||
|
2.34.1
|
||||||
|
Loading…
Reference in New Issue
Block a user