gcc-changelog: accept "CWG nnnn" header

Message ID 20260716143012.3674428-1-jason@redhat.com
State New
Headers
Series gcc-changelog: accept "CWG nnnn" header |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 success Build passed

Commit Message

Jason Merrill July 16, 2026, 2:30 p.m. UTC
  We currently accept "DR" tags as well as "PR" to indicate a C++ defect
report, but the core language and library have different DR numbering and
often we can implement an issue resolution before it becomes a formal DR.
So let's also accept "CWG" and "LWG" tags.

contrib/ChangeLog:

	* gcc-changelog/git_commit.py (dr_regex): Add CWG|LWG.
---
 contrib/gcc-changelog/git_commit.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: ddf645c09461c6ebf444f27ebbcad8141f0dba56
  

Comments

Jakub Jelinek July 16, 2026, 2:38 p.m. UTC | #1
On Thu, Jul 16, 2026 at 10:30:03AM -0400, Jason Merrill wrote:
> We currently accept "DR" tags as well as "PR" to indicate a C++ defect
> report, but the core language and library have different DR numbering and
> often we can implement an issue resolution before it becomes a formal DR.
> So let's also accept "CWG" and "LWG" tags.
> 
> contrib/ChangeLog:
> 
> 	* gcc-changelog/git_commit.py (dr_regex): Add CWG|LWG.

LGTM.
I wonder if we also shouldn't accept
	C++NN PNNNNNRN - text
or maybe also or instead
	PNNNNNRN - text
?
I think that was what was used before the switch to git, now one
usually attempts to put it somewhere in the middle of the ChangeLog
entry, after some filename: at least.

Anyway, after committing this needs to be installed manually on sourceware
(I can do that).

> diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
> index 6329e7eb07a..37c9b668cf9 100755
> --- a/contrib/gcc-changelog/git_commit.py
> +++ b/contrib/gcc-changelog/git_commit.py
> @@ -180,7 +180,7 @@ changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
>  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]+)$')
> +dr_regex = re.compile(r'\t(DR|CWG|LWG) ([0-9]+)$')
>  star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
>  end_of_location_regex = re.compile(r'[\[<(:]')
>  item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$')
> 
> base-commit: ddf645c09461c6ebf444f27ebbcad8141f0dba56

	Jakub
  
Jason Merrill July 17, 2026, 8:55 p.m. UTC | #2
On 7/16/26 10:38 AM, Jakub Jelinek wrote:
> On Thu, Jul 16, 2026 at 10:30:03AM -0400, Jason Merrill wrote:
>> We currently accept "DR" tags as well as "PR" to indicate a C++ defect
>> report, but the core language and library have different DR numbering and
>> often we can implement an issue resolution before it becomes a formal DR.
>> So let's also accept "CWG" and "LWG" tags.
>>
>> contrib/ChangeLog:
>>
>> 	* gcc-changelog/git_commit.py (dr_regex): Add CWG|LWG.
> 
> LGTM.
> I wonder if we also shouldn't accept
> 	C++NN PNNNNNRN - text
> or maybe also or instead
> 	PNNNNNRN - text
> ?
> I think that was what was used before the switch to git, now one
> usually attempts to put it somewhere in the middle of the ChangeLog
> entry, after some filename: at least.
So, like this?

Although, I notice that the script accepts anything as long as it 
precedes the PR number, so with no changes it's fine to write

	CWG 1337
	P3210R42
	PR c++/12345

gcc/ChangeLog:

	* foo.cc: Something.

So maybe no change is really needed?
  
Jakub Jelinek July 17, 2026, 9:11 p.m. UTC | #3
On Fri, Jul 17, 2026 at 04:55:02PM -0400, Jason Merrill wrote:
> On 7/16/26 10:38 AM, Jakub Jelinek wrote:
> > On Thu, Jul 16, 2026 at 10:30:03AM -0400, Jason Merrill wrote:
> > > We currently accept "DR" tags as well as "PR" to indicate a C++ defect
> > > report, but the core language and library have different DR numbering and
> > > often we can implement an issue resolution before it becomes a formal DR.
> > > So let's also accept "CWG" and "LWG" tags.
> > > 
> > > contrib/ChangeLog:
> > > 
> > > 	* gcc-changelog/git_commit.py (dr_regex): Add CWG|LWG.
> > 
> > LGTM.
> > I wonder if we also shouldn't accept
> > 	C++NN PNNNNNRN - text
> > or maybe also or instead
> > 	PNNNNNRN - text
> > ?
> > I think that was what was used before the switch to git, now one
> > usually attempts to put it somewhere in the middle of the ChangeLog
> > entry, after some filename: at least.
> So, like this?
> 
> Although, I notice that the script accepts anything as long as it precedes
> the PR number, so with no changes it's fine to write
> 
> 	CWG 1337
> 	P3210R42
> 	PR c++/12345

Does it include it in the generated ChangeLog though?
Does it accept it in between
date  name  email
line and the PR line too?

> gcc/ChangeLog:
> 
> 	* foo.cc: Something.
> 
> So maybe no change is really needed?

If yes, guess your patch is ok as is then, CWG/LWG issues can have no PRs, but
the papers really better should have one.
If not, the patch below doesn't add there P[0-9]+R[0-9]+ with optional
text after it.

> From 37e6c77392048c868eeeb73490d58e6ffa84c93f Mon Sep 17 00:00:00 2001
> From: Jason Merrill <jason@redhat.com>
> Date: Tue, 14 Jul 2026 12:26:08 -0400
> Subject: [PATCH] gcc-changelog: accept "CWG nnnn" header
> To: gcc-patches@gcc.gnu.org
> 
> We currently accept "DR" tags as well as "PR" to indicate a C++ defect
> report, but the core language and library have different DR numbering and
> often we can implement an issue resolution before it becomes a formal DR.
> So let's also accept "CWG" and "LWG" tags.  And "P2037R7" for paper numbers.
> 
> contrib/ChangeLog:
> 
> 	* gcc-changelog/git_commit.py (dr_regex): Add CWG|LWG.
> ---
>  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 6329e7eb07a..37c9b668cf9 100755
> --- a/contrib/gcc-changelog/git_commit.py
> +++ b/contrib/gcc-changelog/git_commit.py
> @@ -180,7 +180,7 @@ changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
>  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]+)$')
> +dr_regex = re.compile(r'\t(DR|CWG|LWG) ([0-9]+)$')
>  star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
>  end_of_location_regex = re.compile(r'[\[<(:]')
>  item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$')
> -- 
> 2.55.0
> 


	Jakub
  

Patch

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index 6329e7eb07a..37c9b668cf9 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -180,7 +180,7 @@  changelog_regex = re.compile(r'^(?:[fF]or +)?([a-z0-9+-/]*)ChangeLog:?')
 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]+)$')
+dr_regex = re.compile(r'\t(DR|CWG|LWG) ([0-9]+)$')
 star_prefix_regex = re.compile(r'\t\*(?P<spaces>\ *)(?P<content>.*)')
 end_of_location_regex = re.compile(r'[\[<(:]')
 item_empty_regex = re.compile(r'\t(\* \S+ )?\(\S+\):\s*$')