public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH (pushed)] gcc-changelog: allow digit in component name
@ 2022-12-19 13:40 Martin Liška
  2022-12-19 13:54 ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Liška @ 2022-12-19 13:40 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Allow digit in component name.

contrib/ChangeLog:

	* gcc-changelog/test_email.py: Add new test.
	* gcc-changelog/test_patches.txt: Add new patch.
---
  contrib/gcc-changelog/git_commit.py    |  2 +-
  contrib/gcc-changelog/test_email.py    |  4 ++++
  contrib/gcc-changelog/test_patches.txt | 25 +++++++++++++++++++++++++
  3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index e82fbcacd3e..7fde02cba85 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -165,7 +165,7 @@ additional_author_regex = re.compile(r'^\t(?P<spaces>\ *)?(?P<name>.*  <.*>)')
  changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
  subject_pr_regex = re.compile(r'(^|\W)PR\s+(?P<component>[a-zA-Z+-]+)/(?P<pr>\d{4,7})')
  subject_pr2_regex = re.compile(r'[(\[]PR\s*(?P<pr>\d{4,7})[)\]]')
-pr_regex = re.compile(r'\tPR (?P<component>[a-z+-]+\/)?(?P<pr>[0-9]+)$')
+pr_regex = re.compile(r'\tPR (?P<component>[a-z0-9+-]+\/)?(?P<pr>[0-9]+)$')
  dr_regex = re.compile(r'\tDR ([0-9]+)$')
  star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
  end_of_location_regex = re.compile(r'[\[<(:]')
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index 79f8e0b8604..3e311d8d0f1 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -475,3 +475,7 @@ class TestGccChangelog(unittest.TestCase):
          assert (len(email.warnings) == 2)
          assert (email.warnings[0] == "Auto-added new file 'gcc/doc/gm2.texi'")
          assert (email.warnings[1] == "Auto-added 2 new files in 'gcc/m2'")
+
+    def test_digit_in_PR_component(self):
+        email = self.from_patch_glob('modula-PR-component.patch')
+        assert not email.errors
diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt
index 6004608a8f9..8bbd341c399 100644
--- a/contrib/gcc-changelog/test_patches.txt
+++ b/contrib/gcc-changelog/test_patches.txt
@@ -3732,3 +3732,28 @@ index 00000000000..649af5e573a
  +GCC RUNTIME LIBRARY EXCEPTION
  --
  2.25.1
+
+=== modula-PR-component.patch ===
+From 1052d89a0b9769453561e18da32b1558d059b320 Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 19 Dec 2022 14:34:18 +0100
+Subject: [PATCH] gcc-changelog: allow digit in component name
+
+	PR modula2/123456
+
+contrib/ChangeLog:
+
+	* gcc-changelog/git_commit.py: Allow digit in component name.
+---
+ contrib/gcc-changelog/git_commit.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
+index e82fbcacd3e..7fde02cba85 100755
+--- a/contrib/gcc-changelog/git_commit.py
++++ b/contrib/gcc-changelog/git_commit.py
+@@ -0,0 +1,1 @@
++		GNU Free Documentation License
+--
+2.39.0
+
-- 
2.39.0


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

* Re: [PATCH (pushed)] gcc-changelog: allow digit in component name
  2022-12-19 13:40 [PATCH (pushed)] gcc-changelog: allow digit in component name Martin Liška
@ 2022-12-19 13:54 ` Jakub Jelinek
  2022-12-19 13:56   ` [PATCH (pushed)] gcc-changelog: support digits in PR's component in subject Martin Liška
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2022-12-19 13:54 UTC (permalink / raw)
  To: Martin Liška; +Cc: gcc-patches

On Mon, Dec 19, 2022 at 02:40:29PM +0100, Martin Liška wrote:
> contrib/ChangeLog:
> 
> 	* gcc-changelog/git_commit.py: Allow digit in component name.
> 
> contrib/ChangeLog:
> 
> 	* gcc-changelog/test_email.py: Add new test.
> 	* gcc-changelog/test_patches.txt: Add new patch.
> ---
>  contrib/gcc-changelog/git_commit.py    |  2 +-
>  contrib/gcc-changelog/test_email.py    |  4 ++++
>  contrib/gcc-changelog/test_patches.txt | 25 +++++++++++++++++++++++++
>  3 files changed, 30 insertions(+), 1 deletion(-)
> 
> diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
> index e82fbcacd3e..7fde02cba85 100755
> --- a/contrib/gcc-changelog/git_commit.py
> +++ b/contrib/gcc-changelog/git_commit.py
> @@ -165,7 +165,7 @@ additional_author_regex = re.compile(r'^\t(?P<spaces>\ *)?(?P<name>.*  <.*>)')
>  changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
>  subject_pr_regex = re.compile(r'(^|\W)PR\s+(?P<component>[a-zA-Z+-]+)/(?P<pr>\d{4,7})')

What about the above regex, shouldn't that be adjusted too?

>  subject_pr2_regex = re.compile(r'[(\[]PR\s*(?P<pr>\d{4,7})[)\]]')
> -pr_regex = re.compile(r'\tPR (?P<component>[a-z+-]+\/)?(?P<pr>[0-9]+)$')
> +pr_regex = re.compile(r'\tPR (?P<component>[a-z0-9+-]+\/)?(?P<pr>[0-9]+)$')
>  dr_regex = re.compile(r'\tDR ([0-9]+)$')
>  star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
>  end_of_location_regex = re.compile(r'[\[<(:]')

	Jakub


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

* [PATCH (pushed)] gcc-changelog: support digits in PR's component in subject
  2022-12-19 13:54 ` Jakub Jelinek
@ 2022-12-19 13:56   ` Martin Liška
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Liška @ 2022-12-19 13:56 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jakub Jelinek

Yes, fixed in the following patch.

Martin

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Support digits in PR's
	component in subject.
---
  contrib/gcc-changelog/git_commit.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index 7fde02cba85..b73e587eb98 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -163,7 +163,7 @@ author_line_regex = \
          re.compile(r'^(?P<datetime>\d{4}-\d{2}-\d{2})\ {2}(?P<name>.*  <.*>)')
  additional_author_regex = re.compile(r'^\t(?P<spaces>\ *)?(?P<name>.*  <.*>)')
  changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
-subject_pr_regex = re.compile(r'(^|\W)PR\s+(?P<component>[a-zA-Z+-]+)/(?P<pr>\d{4,7})')
+subject_pr_regex = re.compile(r'(^|\W)PR\s+(?P<component>[a-zA-Z0-9+-]+)/(?P<pr>\d{4,7})')
  subject_pr2_regex = re.compile(r'[(\[]PR\s*(?P<pr>\d{4,7})[)\]]')
  pr_regex = re.compile(r'\tPR (?P<component>[a-z0-9+-]+\/)?(?P<pr>[0-9]+)$')
  dr_regex = re.compile(r'\tDR ([0-9]+)$')
-- 
2.39.0


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

end of thread, other threads:[~2022-12-19 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-19 13:40 [PATCH (pushed)] gcc-changelog: allow digit in component name Martin Liška
2022-12-19 13:54 ` Jakub Jelinek
2022-12-19 13:56   ` [PATCH (pushed)] gcc-changelog: support digits in PR's component in subject 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).