RE: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Tamar Christina
Thanks both!

Cheers,
Tamar

> -Original Message-
> From: Martin Liška 
> Sent: Wednesday, June 10, 2020 2:41 PM
> To: Tamar Christina ; Jonathan Wakely
> 
> Cc: Jakub Jelinek ; gcc@gcc.gnu.org; gcc-patches  patc...@gcc.gnu.org>
> Subject: Re: [IMPORTANT] ChangeLog related changes
> 
> On 6/10/20 3:34 PM, Tamar Christina wrote:
> > Hi All,
> >
> 
> Hello.
> 
> > We've been wondering since we no longer list authors in the changelog
> > (at least mklog doesn't generate it),
> 
> You are right, it's preferred solution and it's documented here:
> https://gcc.gnu.org/codingconventions.html#ChangeLogs
> 
> '''
> a commit author and committer date stamp can be automatically deduced
> from a git commit - we recommend to use it '''
> 
> but we miss to document that additional authors are automatically taken
> from:
> Co-Authored-By:
> 
> I'll document that.
> 
> Martin
> 
> > How do we handle multi author patches nowadays?
> >
> > Tried searching for it on the website but couldn’t find anything.
> >
> > Thanks,
> > Tamar
> >
> >> -Original Message-
> >> From: Gcc-patches  On Behalf Of
> >> Martin Liška
> >> Sent: Wednesday, June 10, 2020 8:38 AM
> >> To: Jonathan Wakely 
> >> Cc: Jakub Jelinek ; gcc@gcc.gnu.org; gcc-patches
> >> 
> >> Subject: Re: [IMPORTANT] ChangeLog related changes
> >>
> >> On 6/9/20 10:29 PM, Jonathan Wakely wrote:
> >>> OK, here's a proper patch for the changes you liked, dropping the
> >>> changes to the Error exception type.
> >>>
> >>> pytest contrib/gcc-changelog/test_email.py passes.
> >>>
> >>> OK for master?
> >>
> >> I like it and I've just pushed the patch to master.
> >>
> >> Martin



RE: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Tamar Christina
Thanks both!

Cheers,
Tamar

> -Original Message-
> From: Martin Liška 
> Sent: Wednesday, June 10, 2020 2:41 PM
> To: Tamar Christina ; Jonathan Wakely
> 
> Cc: Jakub Jelinek ; g...@gcc.gnu.org; gcc-patches  patc...@gcc.gnu.org>
> Subject: Re: [IMPORTANT] ChangeLog related changes
> 
> On 6/10/20 3:34 PM, Tamar Christina wrote:
> > Hi All,
> >
> 
> Hello.
> 
> > We've been wondering since we no longer list authors in the changelog
> > (at least mklog doesn't generate it),
> 
> You are right, it's preferred solution and it's documented here:
> https://gcc.gnu.org/codingconventions.html#ChangeLogs
> 
> '''
> a commit author and committer date stamp can be automatically deduced
> from a git commit - we recommend to use it '''
> 
> but we miss to document that additional authors are automatically taken
> from:
> Co-Authored-By:
> 
> I'll document that.
> 
> Martin
> 
> > How do we handle multi author patches nowadays?
> >
> > Tried searching for it on the website but couldn’t find anything.
> >
> > Thanks,
> > Tamar
> >
> >> -Original Message-
> >> From: Gcc-patches  On Behalf Of
> >> Martin Liška
> >> Sent: Wednesday, June 10, 2020 8:38 AM
> >> To: Jonathan Wakely 
> >> Cc: Jakub Jelinek ; g...@gcc.gnu.org; gcc-patches
> >> 
> >> Subject: Re: [IMPORTANT] ChangeLog related changes
> >>
> >> On 6/9/20 10:29 PM, Jonathan Wakely wrote:
> >>> OK, here's a proper patch for the changes you liked, dropping the
> >>> changes to the Error exception type.
> >>>
> >>> pytest contrib/gcc-changelog/test_email.py passes.
> >>>
> >>> OK for master?
> >>
> >> I like it and I've just pushed the patch to master.
> >>
> >> Martin



Re: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Martin Liška

On 6/10/20 3:34 PM, Tamar Christina wrote:

Hi All,



Hello.


We've been wondering since we no longer list authors in the changelog (at least 
mklog doesn't generate it),


You are right, it's preferred solution and it's documented here:
https://gcc.gnu.org/codingconventions.html#ChangeLogs

'''
a commit author and committer date stamp can be automatically deduced from a 
git commit - we recommend to use it
'''

but we miss to document that additional authors are automatically taken from:
Co-Authored-By:

I'll document that.

Martin


How do we handle multi author patches nowadays?

Tried searching for it on the website but couldn’t find anything.

Thanks,
Tamar


-Original Message-
From: Gcc-patches  On Behalf Of Martin
Liška
Sent: Wednesday, June 10, 2020 8:38 AM
To: Jonathan Wakely 
Cc: Jakub Jelinek ; g...@gcc.gnu.org; gcc-patches 
Subject: Re: [IMPORTANT] ChangeLog related changes

On 6/9/20 10:29 PM, Jonathan Wakely wrote:

OK, here's a proper patch for the changes you liked, dropping the
changes to the Error exception type.

pytest contrib/gcc-changelog/test_email.py passes.

OK for master?


I like it and I've just pushed the patch to master.

Martin




Re: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Martin Liška

On 6/10/20 3:34 PM, Tamar Christina wrote:

Hi All,



Hello.


We've been wondering since we no longer list authors in the changelog (at least 
mklog doesn't generate it),


You are right, it's preferred solution and it's documented here:
https://gcc.gnu.org/codingconventions.html#ChangeLogs

'''
a commit author and committer date stamp can be automatically deduced from a 
git commit - we recommend to use it
'''

but we miss to document that additional authors are automatically taken from:
Co-Authored-By:

I'll document that.

Martin


How do we handle multi author patches nowadays?

Tried searching for it on the website but couldn’t find anything.

Thanks,
Tamar


-Original Message-
From: Gcc-patches  On Behalf Of Martin
Liška
Sent: Wednesday, June 10, 2020 8:38 AM
To: Jonathan Wakely 
Cc: Jakub Jelinek ; gcc@gcc.gnu.org; gcc-patches 
Subject: Re: [IMPORTANT] ChangeLog related changes

On 6/9/20 10:29 PM, Jonathan Wakely wrote:

OK, here's a proper patch for the changes you liked, dropping the
changes to the Error exception type.

pytest contrib/gcc-changelog/test_email.py passes.

OK for master?


I like it and I've just pushed the patch to master.

Martin




Re: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Marek Polacek via Gcc
On Wed, Jun 10, 2020 at 01:34:54PM +, Tamar Christina wrote:
> Hi All,
> 
> We've been wondering since we no longer list authors in the changelog (at 
> least mklog doesn't generate it),
> How do we handle multi author patches nowadays?
> 
> Tried searching for it on the website but couldn’t find anything.

You can add Co-authored-by: name  to your commit.

If we don't already document it, we should.

Marek



Re: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Marek Polacek via Gcc-patches
On Wed, Jun 10, 2020 at 01:34:54PM +, Tamar Christina wrote:
> Hi All,
> 
> We've been wondering since we no longer list authors in the changelog (at 
> least mklog doesn't generate it),
> How do we handle multi author patches nowadays?
> 
> Tried searching for it on the website but couldn’t find anything.

You can add Co-authored-by: name  to your commit.

If we don't already document it, we should.

Marek



RE: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Tamar Christina
Hi All,

We've been wondering since we no longer list authors in the changelog (at least 
mklog doesn't generate it),
How do we handle multi author patches nowadays?

Tried searching for it on the website but couldn’t find anything.

Thanks,
Tamar

> -Original Message-
> From: Gcc-patches  On Behalf Of Martin
> Liška
> Sent: Wednesday, June 10, 2020 8:38 AM
> To: Jonathan Wakely 
> Cc: Jakub Jelinek ; gcc@gcc.gnu.org; gcc-patches  patc...@gcc.gnu.org>
> Subject: Re: [IMPORTANT] ChangeLog related changes
> 
> On 6/9/20 10:29 PM, Jonathan Wakely wrote:
> > OK, here's a proper patch for the changes you liked, dropping the
> > changes to the Error exception type.
> >
> > pytest contrib/gcc-changelog/test_email.py passes.
> >
> > OK for master?
> 
> I like it and I've just pushed the patch to master.
> 
> Martin


RE: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Tamar Christina
Hi All,

We've been wondering since we no longer list authors in the changelog (at least 
mklog doesn't generate it),
How do we handle multi author patches nowadays?

Tried searching for it on the website but couldn’t find anything.

Thanks,
Tamar

> -Original Message-
> From: Gcc-patches  On Behalf Of Martin
> Liška
> Sent: Wednesday, June 10, 2020 8:38 AM
> To: Jonathan Wakely 
> Cc: Jakub Jelinek ; g...@gcc.gnu.org; gcc-patches  patc...@gcc.gnu.org>
> Subject: Re: [IMPORTANT] ChangeLog related changes
> 
> On 6/9/20 10:29 PM, Jonathan Wakely wrote:
> > OK, here's a proper patch for the changes you liked, dropping the
> > changes to the Error exception type.
> >
> > pytest contrib/gcc-changelog/test_email.py passes.
> >
> > OK for master?
> 
> I like it and I've just pushed the patch to master.
> 
> Martin


Re: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Martin Liška

On 6/9/20 10:29 PM, Jonathan Wakely wrote:

OK, here's a proper patch for the changes you liked, dropping the
changes to the Error exception type.

pytest contrib/gcc-changelog/test_email.py passes.

OK for master?


I like it and I've just pushed the patch to master.

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-06-10 Thread Martin Liška

On 6/9/20 10:29 PM, Jonathan Wakely wrote:

OK, here's a proper patch for the changes you liked, dropping the
changes to the Error exception type.

pytest contrib/gcc-changelog/test_email.py passes.

OK for master?


I like it and I've just pushed the patch to master.

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-06-09 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Jun 2020 at 15:25, Martin Liška  wrote:
>
> On 6/2/20 4:14 PM, Jonathan Wakely wrote:
> > On Tue, 2 Jun 2020 at 14:56, Jonathan Wakely  wrote:
> >>
> >> On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:
> >>>
> >>> On 6/2/20 1:48 PM, Martin Liška wrote:
>  I tend to this approach. Let me prepare a patch candidate for it.
> >>>
> >>> There's a patch for it. Can you please Jonathan take a look?
> >>
> >> Looks great, thanks!
> >>
> >> +if name not in wildcard_prefixes:
> >> +msg = 'unsupported wilcard prefix'
> >>
> >> Typo "wilcard"
> >>
> >> +if pattern not in used_patterns:
> >> +self.errors.append(Error('a file pattern not used in a 
> >> patch',
> >> + pattern))
> >>
> >> If the script printed this error I don't think I'd know what it was
> >> complaining about. How about "pattern doesn't match any changed files"
> >> ?
> >>
> >> I find the existing error 'file not changed in a patch' to be
> >> suboptimal too. We're checking revisions (or commits), not patches.
> >
> > Along those lines, here's an incomplete patch (tests aren't updated
> > yet, no commit log, your latest change isn't merged ) to revise the
> > error messages. I've tried to make them more consistent (e.g change
> > 'file not changed in a patch' to 'unchanged file mentioned in a
> > ChangeLog' which mirrors the error for the opposite condition,
> > 'changed file not mentioned in a ChangeLog').
>
> I welcome this.
>
> >
> > I've also moved line numbers to the start of the line (like GCC's own
> > diagnostics) and not used the "line" argument of the Error constructor
> > for things that aren't line numbers. I've aimed to be consistent, so
> > that line numbers come at the start, pathnames and patterns come at
> > the end (and there's a space before them).
>
> Well, the Error ctor argument 'line' is bit misleading. It's a string and
> not an integer:
>
>File "/home/marxin/Programming/gcc/contrib/gcc-changelog/git_commit.py", 
> line 177, in __repr__
>  return '%d: %s' % (self.line, self.message)
> TypeError: %d format: a number is required, not str
>
> and it represents a line from a git commit message. I use it in order to 
> provide
> line which is affected by an error.
>
> >
> > I also suggest changing 'additional author must prepend with tab and 4
> > spaces' to 'additional author must be indented with one tab and four
> > spaces'.>
> > The intent is to improve the user experience, since for many people
> > who are new to git *any* error can cause confusion, so extra,
> > gcc-specific errors that we issue should aim to be easy to understand.
>
> I like your wordings.

OK, here's a proper patch for the changes you liked, dropping the
changes to the Error exception type.

pytest contrib/gcc-changelog/test_email.py passes.

OK for master?
commit 49652b7f5b57b88c1e0e27cf8ac488cbc85f1c7d
Author: Jonathan Wakely 
Date:   Tue Jun 9 21:25:50 2020 +0100

gcc-changelog: Improve git_commit.py diagnostics

This changes some error messages to be more self-consistent and to fix
some grammar.

contrib/ChangeLog:

* gcc-changelog/git_commit.py (GitCommit.parse_changelog):
Improve error strings.
* gcc-changelog/test_email.py: Update expected errors.

diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index f85d4c83c63..0b350ba7fda 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -377,8 +377,8 @@ class GitCommit:
 elif additional_author_regex.match(line):
 m = additional_author_regex.match(line)
 if len(m.group('spaces')) != 4:
-msg = 'additional author must prepend with tab ' \
-  'and 4 spaces'
+msg = 'additional author must be indented with '\
+  'one tab and four spaces'
 self.errors.append(Error(msg, line))
 else:
 author_tuple = (m.group('name'), None)
@@ -438,15 +438,14 @@ class GitCommit:
 m = star_prefix_regex.match(line)
 if m:
 if len(m.group('spaces')) != 1:
-err = Error('one space should follow asterisk',
-line)
-self.errors.append(err)
+msg = 'one space should follow asterisk'
+self.errors.append(Error(msg, line))
 else:
 last_entry.lines.append(line)
 else:
 if last_entry.is_empty:
 msg = 'first line should start with a tab, ' \
-  'asterisk and space'
+   

Re: [IMPORTANT] ChangeLog related changes

2020-06-09 Thread Jonathan Wakely via Gcc
On Tue, 2 Jun 2020 at 15:25, Martin Liška  wrote:
>
> On 6/2/20 4:14 PM, Jonathan Wakely wrote:
> > On Tue, 2 Jun 2020 at 14:56, Jonathan Wakely  wrote:
> >>
> >> On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:
> >>>
> >>> On 6/2/20 1:48 PM, Martin Liška wrote:
>  I tend to this approach. Let me prepare a patch candidate for it.
> >>>
> >>> There's a patch for it. Can you please Jonathan take a look?
> >>
> >> Looks great, thanks!
> >>
> >> +if name not in wildcard_prefixes:
> >> +msg = 'unsupported wilcard prefix'
> >>
> >> Typo "wilcard"
> >>
> >> +if pattern not in used_patterns:
> >> +self.errors.append(Error('a file pattern not used in a 
> >> patch',
> >> + pattern))
> >>
> >> If the script printed this error I don't think I'd know what it was
> >> complaining about. How about "pattern doesn't match any changed files"
> >> ?
> >>
> >> I find the existing error 'file not changed in a patch' to be
> >> suboptimal too. We're checking revisions (or commits), not patches.
> >
> > Along those lines, here's an incomplete patch (tests aren't updated
> > yet, no commit log, your latest change isn't merged ) to revise the
> > error messages. I've tried to make them more consistent (e.g change
> > 'file not changed in a patch' to 'unchanged file mentioned in a
> > ChangeLog' which mirrors the error for the opposite condition,
> > 'changed file not mentioned in a ChangeLog').
>
> I welcome this.
>
> >
> > I've also moved line numbers to the start of the line (like GCC's own
> > diagnostics) and not used the "line" argument of the Error constructor
> > for things that aren't line numbers. I've aimed to be consistent, so
> > that line numbers come at the start, pathnames and patterns come at
> > the end (and there's a space before them).
>
> Well, the Error ctor argument 'line' is bit misleading. It's a string and
> not an integer:
>
>File "/home/marxin/Programming/gcc/contrib/gcc-changelog/git_commit.py", 
> line 177, in __repr__
>  return '%d: %s' % (self.line, self.message)
> TypeError: %d format: a number is required, not str
>
> and it represents a line from a git commit message. I use it in order to 
> provide
> line which is affected by an error.
>
> >
> > I also suggest changing 'additional author must prepend with tab and 4
> > spaces' to 'additional author must be indented with one tab and four
> > spaces'.>
> > The intent is to improve the user experience, since for many people
> > who are new to git *any* error can cause confusion, so extra,
> > gcc-specific errors that we issue should aim to be easy to understand.
>
> I like your wordings.

OK, here's a proper patch for the changes you liked, dropping the
changes to the Error exception type.

pytest contrib/gcc-changelog/test_email.py passes.

OK for master?
commit 49652b7f5b57b88c1e0e27cf8ac488cbc85f1c7d
Author: Jonathan Wakely 
Date:   Tue Jun 9 21:25:50 2020 +0100

gcc-changelog: Improve git_commit.py diagnostics

This changes some error messages to be more self-consistent and to fix
some grammar.

contrib/ChangeLog:

* gcc-changelog/git_commit.py (GitCommit.parse_changelog):
Improve error strings.
* gcc-changelog/test_email.py: Update expected errors.

diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index f85d4c83c63..0b350ba7fda 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -377,8 +377,8 @@ class GitCommit:
 elif additional_author_regex.match(line):
 m = additional_author_regex.match(line)
 if len(m.group('spaces')) != 4:
-msg = 'additional author must prepend with tab ' \
-  'and 4 spaces'
+msg = 'additional author must be indented with '\
+  'one tab and four spaces'
 self.errors.append(Error(msg, line))
 else:
 author_tuple = (m.group('name'), None)
@@ -438,15 +438,14 @@ class GitCommit:
 m = star_prefix_regex.match(line)
 if m:
 if len(m.group('spaces')) != 1:
-err = Error('one space should follow asterisk',
-line)
-self.errors.append(err)
+msg = 'one space should follow asterisk'
+self.errors.append(Error(msg, line))
 else:
 last_entry.lines.append(line)
 else:
 if last_entry.is_empty:
 msg = 'first line should start with a tab, ' \
-  'asterisk and space'
+   

Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 4:14 PM, Jonathan Wakely wrote:

On Tue, 2 Jun 2020 at 14:56, Jonathan Wakely  wrote:


On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:


On 6/2/20 1:48 PM, Martin Liška wrote:

I tend to this approach. Let me prepare a patch candidate for it.


There's a patch for it. Can you please Jonathan take a look?


Looks great, thanks!

+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'

Typo "wilcard"

+if pattern not in used_patterns:
+self.errors.append(Error('a file pattern not used in a patch',
+ pattern))

If the script printed this error I don't think I'd know what it was
complaining about. How about "pattern doesn't match any changed files"
?

I find the existing error 'file not changed in a patch' to be
suboptimal too. We're checking revisions (or commits), not patches.


Along those lines, here's an incomplete patch (tests aren't updated
yet, no commit log, your latest change isn't merged ) to revise the
error messages. I've tried to make them more consistent (e.g change
'file not changed in a patch' to 'unchanged file mentioned in a
ChangeLog' which mirrors the error for the opposite condition,
'changed file not mentioned in a ChangeLog').


I welcome this.



I've also moved line numbers to the start of the line (like GCC's own
diagnostics) and not used the "line" argument of the Error constructor
for things that aren't line numbers. I've aimed to be consistent, so
that line numbers come at the start, pathnames and patterns come at
the end (and there's a space before them).


Well, the Error ctor argument 'line' is bit misleading. It's a string and
not an integer:

  File "/home/marxin/Programming/gcc/contrib/gcc-changelog/git_commit.py", line 
177, in __repr__
return '%d: %s' % (self.line, self.message)
TypeError: %d format: a number is required, not str

and it represents a line from a git commit message. I use it in order to provide
line which is affected by an error.



I also suggest changing 'additional author must prepend with tab and 4
spaces' to 'additional author must be indented with one tab and four
spaces'.> 
The intent is to improve the user experience, since for many people

who are new to git *any* error can cause confusion, so extra,
gcc-specific errors that we issue should aim to be easy to understand.


I like your wordings.

Martin



Do you like the direction?





Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 4:14 PM, Jonathan Wakely wrote:

On Tue, 2 Jun 2020 at 14:56, Jonathan Wakely  wrote:


On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:


On 6/2/20 1:48 PM, Martin Liška wrote:

I tend to this approach. Let me prepare a patch candidate for it.


There's a patch for it. Can you please Jonathan take a look?


Looks great, thanks!

+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'

Typo "wilcard"

+if pattern not in used_patterns:
+self.errors.append(Error('a file pattern not used in a patch',
+ pattern))

If the script printed this error I don't think I'd know what it was
complaining about. How about "pattern doesn't match any changed files"
?

I find the existing error 'file not changed in a patch' to be
suboptimal too. We're checking revisions (or commits), not patches.


Along those lines, here's an incomplete patch (tests aren't updated
yet, no commit log, your latest change isn't merged ) to revise the
error messages. I've tried to make them more consistent (e.g change
'file not changed in a patch' to 'unchanged file mentioned in a
ChangeLog' which mirrors the error for the opposite condition,
'changed file not mentioned in a ChangeLog').


I welcome this.



I've also moved line numbers to the start of the line (like GCC's own
diagnostics) and not used the "line" argument of the Error constructor
for things that aren't line numbers. I've aimed to be consistent, so
that line numbers come at the start, pathnames and patterns come at
the end (and there's a space before them).


Well, the Error ctor argument 'line' is bit misleading. It's a string and
not an integer:

  File "/home/marxin/Programming/gcc/contrib/gcc-changelog/git_commit.py", line 
177, in __repr__
return '%d: %s' % (self.line, self.message)
TypeError: %d format: a number is required, not str

and it represents a line from a git commit message. I use it in order to provide
line which is affected by an error.



I also suggest changing 'additional author must prepend with tab and 4
spaces' to 'additional author must be indented with one tab and four
spaces'.> 
The intent is to improve the user experience, since for many people

who are new to git *any* error can cause confusion, so extra,
gcc-specific errors that we issue should aim to be easy to understand.


I like your wordings.

Martin



Do you like the direction?





Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc
On Tue, 2 Jun 2020 at 14:56, Jonathan Wakely  wrote:
>
> On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:
> >
> > On 6/2/20 1:48 PM, Martin Liška wrote:
> > > I tend to this approach. Let me prepare a patch candidate for it.
> >
> > There's a patch for it. Can you please Jonathan take a look?
>
> Looks great, thanks!
>
> +if name not in wildcard_prefixes:
> +msg = 'unsupported wilcard prefix'
>
> Typo "wilcard"
>
> +if pattern not in used_patterns:
> +self.errors.append(Error('a file pattern not used in a 
> patch',
> + pattern))
>
> If the script printed this error I don't think I'd know what it was
> complaining about. How about "pattern doesn't match any changed files"
> ?
>
> I find the existing error 'file not changed in a patch' to be
> suboptimal too. We're checking revisions (or commits), not patches.

Along those lines, here's an incomplete patch (tests aren't updated
yet, no commit log, your latest change isn't merged ) to revise the
error messages. I've tried to make them more consistent (e.g change
'file not changed in a patch' to 'unchanged file mentioned in a
ChangeLog' which mirrors the error for the opposite condition,
'changed file not mentioned in a ChangeLog').

I've also moved line numbers to the start of the line (like GCC's own
diagnostics) and not used the "line" argument of the Error constructor
for things that aren't line numbers. I've aimed to be consistent, so
that line numbers come at the start, pathnames and patterns come at
the end (and there's a space before them).

I also suggest changing 'additional author must prepend with tab and 4
spaces' to 'additional author must be indented with one tab and four
spaces'.

The intent is to improve the user experience, since for many people
who are new to git *any* error can cause confusion, so extra,
gcc-specific errors that we issue should aim to be easy to understand.

Do you like the direction?
diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index 069900d7cbf..453f0f61803 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -173,10 +173,9 @@ class Error:
 self.line = line
 
 def __repr__(self):
-s = self.message
 if self.line:
-s += ':"%s"' % self.line
-return s
+return '%d: %s' % (self.line, self.message)
+return self.message
 
 
 class ChangeLogEntry:
@@ -376,8 +375,8 @@ class GitCommit:
 elif additional_author_regex.match(line):
 m = additional_author_regex.match(line)
 if len(m.group('spaces')) != 4:
-msg = 'additional author must prepend with tab ' \
-  'and 4 spaces'
+msg = 'additional author must be indented with '\
+  ' one tab and four spaces'
 self.errors.append(Error(msg, line))
 else:
 author_tuple = (m.group('name'), None)
@@ -437,15 +436,14 @@ class GitCommit:
 m = star_prefix_regex.match(line)
 if m:
 if len(m.group('spaces')) != 1:
-err = Error('one space should follow asterisk',
-line)
-self.errors.append(err)
+msg = 'one space should follow asterisk'
+self.errors.append(Error(msg, line))
 else:
 last_entry.lines.append(line)
 else:
 if last_entry.is_empty:
 msg = 'first line should start with a tab, ' \
-  'asterisk and space'
+  'an asterisk and a space'
 self.errors.append(Error(msg, line))
 else:
 last_entry.lines.append(line)
@@ -526,8 +524,8 @@ class GitCommit:
 used_patterns = set()
 for entry in self.changelog_entries:
 if not entry.files:
-msg = 'ChangeLog must contain at least one file entry'
-self.errors.append(Error(msg, entry.folder))
+msg = 'no files mentioned for ChangeLog in directory: "%s"'
+self.errors.append(Error(msg % entry.folder))
 assert not entry.folder.endswith('/')
 for file in entry.files:
 if not self.is_changelog_filename(file):
@@ -539,7 +537,8 @@ class GitCommit:
 if not self.is_changelog_filename(x[0])]
 changed_files = set(cand)
 for file in sorted(mentioned_files - changed_files):
-self.errors.append(Error('file not changed in a patch', file))
+msg 

Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Jun 2020 at 14:56, Jonathan Wakely  wrote:
>
> On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:
> >
> > On 6/2/20 1:48 PM, Martin Liška wrote:
> > > I tend to this approach. Let me prepare a patch candidate for it.
> >
> > There's a patch for it. Can you please Jonathan take a look?
>
> Looks great, thanks!
>
> +if name not in wildcard_prefixes:
> +msg = 'unsupported wilcard prefix'
>
> Typo "wilcard"
>
> +if pattern not in used_patterns:
> +self.errors.append(Error('a file pattern not used in a 
> patch',
> + pattern))
>
> If the script printed this error I don't think I'd know what it was
> complaining about. How about "pattern doesn't match any changed files"
> ?
>
> I find the existing error 'file not changed in a patch' to be
> suboptimal too. We're checking revisions (or commits), not patches.

Along those lines, here's an incomplete patch (tests aren't updated
yet, no commit log, your latest change isn't merged ) to revise the
error messages. I've tried to make them more consistent (e.g change
'file not changed in a patch' to 'unchanged file mentioned in a
ChangeLog' which mirrors the error for the opposite condition,
'changed file not mentioned in a ChangeLog').

I've also moved line numbers to the start of the line (like GCC's own
diagnostics) and not used the "line" argument of the Error constructor
for things that aren't line numbers. I've aimed to be consistent, so
that line numbers come at the start, pathnames and patterns come at
the end (and there's a space before them).

I also suggest changing 'additional author must prepend with tab and 4
spaces' to 'additional author must be indented with one tab and four
spaces'.

The intent is to improve the user experience, since for many people
who are new to git *any* error can cause confusion, so extra,
gcc-specific errors that we issue should aim to be easy to understand.

Do you like the direction?
diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index 069900d7cbf..453f0f61803 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -173,10 +173,9 @@ class Error:
 self.line = line
 
 def __repr__(self):
-s = self.message
 if self.line:
-s += ':"%s"' % self.line
-return s
+return '%d: %s' % (self.line, self.message)
+return self.message
 
 
 class ChangeLogEntry:
@@ -376,8 +375,8 @@ class GitCommit:
 elif additional_author_regex.match(line):
 m = additional_author_regex.match(line)
 if len(m.group('spaces')) != 4:
-msg = 'additional author must prepend with tab ' \
-  'and 4 spaces'
+msg = 'additional author must be indented with '\
+  ' one tab and four spaces'
 self.errors.append(Error(msg, line))
 else:
 author_tuple = (m.group('name'), None)
@@ -437,15 +436,14 @@ class GitCommit:
 m = star_prefix_regex.match(line)
 if m:
 if len(m.group('spaces')) != 1:
-err = Error('one space should follow asterisk',
-line)
-self.errors.append(err)
+msg = 'one space should follow asterisk'
+self.errors.append(Error(msg, line))
 else:
 last_entry.lines.append(line)
 else:
 if last_entry.is_empty:
 msg = 'first line should start with a tab, ' \
-  'asterisk and space'
+  'an asterisk and a space'
 self.errors.append(Error(msg, line))
 else:
 last_entry.lines.append(line)
@@ -526,8 +524,8 @@ class GitCommit:
 used_patterns = set()
 for entry in self.changelog_entries:
 if not entry.files:
-msg = 'ChangeLog must contain at least one file entry'
-self.errors.append(Error(msg, entry.folder))
+msg = 'no files mentioned for ChangeLog in directory: "%s"'
+self.errors.append(Error(msg % entry.folder))
 assert not entry.folder.endswith('/')
 for file in entry.files:
 if not self.is_changelog_filename(file):
@@ -539,7 +537,8 @@ class GitCommit:
 if not self.is_changelog_filename(x[0])]
 changed_files = set(cand)
 for file in sorted(mentioned_files - changed_files):
-self.errors.append(Error('file not changed in a patch', file))
+msg 

Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 3:56 PM, Jonathan Wakely wrote:

On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:


On 6/2/20 1:48 PM, Martin Liška wrote:

I tend to this approach. Let me prepare a patch candidate for it.


There's a patch for it. Can you please Jonathan take a look?


Looks great, thanks!

+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'

Typo "wilcard"

+if pattern not in used_patterns:
+self.errors.append(Error('a file pattern not used in a patch',
+ pattern))

If the script printed this error I don't think I'd know what it was
complaining about. How about "pattern doesn't match any changed files"
?


Yes, thank you for the corrections. I've just pushed that to master.

Martin



I find the existing error 'file not changed in a patch' to be
suboptimal too. We're checking revisions (or commits), not patches.





Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 3:56 PM, Jonathan Wakely wrote:

On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:


On 6/2/20 1:48 PM, Martin Liška wrote:

I tend to this approach. Let me prepare a patch candidate for it.


There's a patch for it. Can you please Jonathan take a look?


Looks great, thanks!

+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'

Typo "wilcard"

+if pattern not in used_patterns:
+self.errors.append(Error('a file pattern not used in a patch',
+ pattern))

If the script printed this error I don't think I'd know what it was
complaining about. How about "pattern doesn't match any changed files"
?


Yes, thank you for the corrections. I've just pushed that to master.

Martin



I find the existing error 'file not changed in a patch' to be
suboptimal too. We're checking revisions (or commits), not patches.





Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc
On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:
>
> On 6/2/20 1:48 PM, Martin Liška wrote:
> > I tend to this approach. Let me prepare a patch candidate for it.
>
> There's a patch for it. Can you please Jonathan take a look?

Looks great, thanks!

+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'

Typo "wilcard"

+if pattern not in used_patterns:
+self.errors.append(Error('a file pattern not used in a patch',
+ pattern))

If the script printed this error I don't think I'd know what it was
complaining about. How about "pattern doesn't match any changed files"
?

I find the existing error 'file not changed in a patch' to be
suboptimal too. We're checking revisions (or commits), not patches.


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Jun 2020 at 14:16, Martin Liška  wrote:
>
> On 6/2/20 1:48 PM, Martin Liška wrote:
> > I tend to this approach. Let me prepare a patch candidate for it.
>
> There's a patch for it. Can you please Jonathan take a look?

Looks great, thanks!

+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'

Typo "wilcard"

+if pattern not in used_patterns:
+self.errors.append(Error('a file pattern not used in a patch',
+ pattern))

If the script printed this error I don't think I'd know what it was
complaining about. How about "pattern doesn't match any changed files"
?

I find the existing error 'file not changed in a patch' to be
suboptimal too. We're checking revisions (or commits), not patches.


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 1:48 PM, Martin Liška wrote:

I tend to this approach. Let me prepare a patch candidate for it.


There's a patch for it. Can you please Jonathan take a look?

Thanks,
Martin
>From 4d2cf31b6deb03c9ddc8062b9a45d2511e4a58bb Mon Sep 17 00:00:00 2001
From: Martin Liska 
Date: Tue, 2 Jun 2020 15:13:22 +0200
Subject: [PATCH] gcc-changelog: support patterns

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Support foo/bar/*: patterns in
	wildcard_prefixes locations.
	* gcc-changelog/test_email.py: Test it.
	* gcc-changelog/test_patches.txt: Add 3 new patches.
---
 contrib/gcc-changelog/git_commit.py| 52 +---
 contrib/gcc-changelog/test_email.py| 12 
 contrib/gcc-changelog/test_patches.txt | 86 ++
 3 files changed, 142 insertions(+), 8 deletions(-)

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index e2ef6c61ed0..37a3ef3fa92 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -136,6 +136,11 @@ ignored_prefixes = [
 'libsanitizer/',
 ]
 
+wildcard_prefixes = [
+'gcc/testsuite/',
+'libstdc++-v3/doc/html/'
+]
+
 misc_files = [
 'gcc/DATESTAMP',
 'gcc/BASE-VER',
@@ -182,11 +187,10 @@ class ChangeLogEntry:
 self.initial_prs = list(prs)
 self.prs = list(prs)
 self.lines = []
+self.files = []
+self.file_patterns = []
 
-@property
-def files(self):
-files = []
-
+def parse_file_names(self):
 # Whether the content currently processed is between a star prefix the
 # end of the file list: a colon or an open paren.
 in_location = False
@@ -215,8 +219,10 @@ class ChangeLogEntry:
 for file in line.split(','):
 file = file.strip()
 if file:
-files.append(file)
-return files
+if file.endswith('*'):
+self.file_patterns.append(file[:-1])
+else:
+self.files.append(file)
 
 @property
 def datetime(self):
@@ -275,8 +281,10 @@ class GitCommit:
 self.parse_lines(all_are_ignored)
 if self.changes:
 self.parse_changelog()
+self.parse_file_names()
 self.check_for_empty_description()
 self.deduce_changelog_locations()
+self.check_file_patterns()
 if not self.errors:
 self.check_mentioned_files()
 self.check_for_correct_changelog()
@@ -442,6 +450,18 @@ class GitCommit:
 else:
 last_entry.lines.append(line)
 
+def parse_file_names(self):
+for entry in self.changelog_entries:
+entry.parse_file_names()
+
+def check_file_patterns(self):
+for entry in self.changelog_entries:
+for pattern in entry.file_patterns:
+name = os.path.join(entry.folder, pattern)
+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'
+self.errors.append(Error(msg, name))
+
 def check_for_empty_description(self):
 for entry in self.changelog_entries:
 for i, line in enumerate(entry.lines):
@@ -502,6 +522,8 @@ class GitCommit:
 assert folder_count == len(self.changelog_entries)
 
 mentioned_files = set()
+mentioned_patterns = []
+used_patterns = set()
 for entry in self.changelog_entries:
 if not entry.files:
 msg = 'ChangeLog must contain at least one file entry'
@@ -510,6 +532,8 @@ class GitCommit:
 for file in entry.files:
 if not self.is_changelog_filename(file):
 mentioned_files.add(os.path.join(entry.folder, file))
+for pattern in entry.file_patterns:
+mentioned_patterns.append(os.path.join(entry.folder, pattern))
 
 cand = [x[0] for x in self.modified_files
 if not self.is_changelog_filename(x[0])]
@@ -543,9 +567,21 @@ class GitCommit:
 assert file.startswith(entry.folder)
 file = file[len(entry.folder):].lstrip('/')
 entry.lines.append('\t* %s: New file.' % file)
+entry.files.append(file)
 else:
-msg = 'changed file not mentioned in a ChangeLog'
-self.errors.append(Error(msg, file))
+used_pattern = [p for p in mentioned_patterns
+if file.startswith(p)]
+used_pattern = used_pattern[0] if used_pattern else None
+if used_pattern:
+used_patterns.add(used_pattern)
+else:
+msg = 'changed file not mentioned in a ChangeLog'
+

Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 1:48 PM, Martin Liška wrote:

I tend to this approach. Let me prepare a patch candidate for it.


There's a patch for it. Can you please Jonathan take a look?

Thanks,
Martin
>From 4d2cf31b6deb03c9ddc8062b9a45d2511e4a58bb Mon Sep 17 00:00:00 2001
From: Martin Liska 
Date: Tue, 2 Jun 2020 15:13:22 +0200
Subject: [PATCH] gcc-changelog: support patterns

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Support foo/bar/*: patterns in
	wildcard_prefixes locations.
	* gcc-changelog/test_email.py: Test it.
	* gcc-changelog/test_patches.txt: Add 3 new patches.
---
 contrib/gcc-changelog/git_commit.py| 52 +---
 contrib/gcc-changelog/test_email.py| 12 
 contrib/gcc-changelog/test_patches.txt | 86 ++
 3 files changed, 142 insertions(+), 8 deletions(-)

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index e2ef6c61ed0..37a3ef3fa92 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -136,6 +136,11 @@ ignored_prefixes = [
 'libsanitizer/',
 ]
 
+wildcard_prefixes = [
+'gcc/testsuite/',
+'libstdc++-v3/doc/html/'
+]
+
 misc_files = [
 'gcc/DATESTAMP',
 'gcc/BASE-VER',
@@ -182,11 +187,10 @@ class ChangeLogEntry:
 self.initial_prs = list(prs)
 self.prs = list(prs)
 self.lines = []
+self.files = []
+self.file_patterns = []
 
-@property
-def files(self):
-files = []
-
+def parse_file_names(self):
 # Whether the content currently processed is between a star prefix the
 # end of the file list: a colon or an open paren.
 in_location = False
@@ -215,8 +219,10 @@ class ChangeLogEntry:
 for file in line.split(','):
 file = file.strip()
 if file:
-files.append(file)
-return files
+if file.endswith('*'):
+self.file_patterns.append(file[:-1])
+else:
+self.files.append(file)
 
 @property
 def datetime(self):
@@ -275,8 +281,10 @@ class GitCommit:
 self.parse_lines(all_are_ignored)
 if self.changes:
 self.parse_changelog()
+self.parse_file_names()
 self.check_for_empty_description()
 self.deduce_changelog_locations()
+self.check_file_patterns()
 if not self.errors:
 self.check_mentioned_files()
 self.check_for_correct_changelog()
@@ -442,6 +450,18 @@ class GitCommit:
 else:
 last_entry.lines.append(line)
 
+def parse_file_names(self):
+for entry in self.changelog_entries:
+entry.parse_file_names()
+
+def check_file_patterns(self):
+for entry in self.changelog_entries:
+for pattern in entry.file_patterns:
+name = os.path.join(entry.folder, pattern)
+if name not in wildcard_prefixes:
+msg = 'unsupported wilcard prefix'
+self.errors.append(Error(msg, name))
+
 def check_for_empty_description(self):
 for entry in self.changelog_entries:
 for i, line in enumerate(entry.lines):
@@ -502,6 +522,8 @@ class GitCommit:
 assert folder_count == len(self.changelog_entries)
 
 mentioned_files = set()
+mentioned_patterns = []
+used_patterns = set()
 for entry in self.changelog_entries:
 if not entry.files:
 msg = 'ChangeLog must contain at least one file entry'
@@ -510,6 +532,8 @@ class GitCommit:
 for file in entry.files:
 if not self.is_changelog_filename(file):
 mentioned_files.add(os.path.join(entry.folder, file))
+for pattern in entry.file_patterns:
+mentioned_patterns.append(os.path.join(entry.folder, pattern))
 
 cand = [x[0] for x in self.modified_files
 if not self.is_changelog_filename(x[0])]
@@ -543,9 +567,21 @@ class GitCommit:
 assert file.startswith(entry.folder)
 file = file[len(entry.folder):].lstrip('/')
 entry.lines.append('\t* %s: New file.' % file)
+entry.files.append(file)
 else:
-msg = 'changed file not mentioned in a ChangeLog'
-self.errors.append(Error(msg, file))
+used_pattern = [p for p in mentioned_patterns
+if file.startswith(p)]
+used_pattern = used_pattern[0] if used_pattern else None
+if used_pattern:
+used_patterns.add(used_pattern)
+else:
+msg = 'changed file not mentioned in a ChangeLog'
+

Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 1:22 PM, Jonathan Wakely via Gcc-patches wrote:

On Tue, 2 Jun 2020 at 12:09, Jonathan Wakely  wrote:


On Tue, 2 Jun 2020 at 12:05, Jonathan Wakely  wrote:


On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:


On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:

The libstdc++ manual is written in Docbook XML, but we commit both the
XML and generated HTML pages to Git. Sometimes a small XML file can
result in dozens of mechanical changes to the generated HTML files,
which we record in the ChangeLog as:

 * doc/html/*: Regenerated.

With the new checks we need to name every generated file individually.

If we add that directory to the ignored_prefixes list, we won't need
to name them. But then the doc/html/* entry will give an error, and
changes to the HTML files can be committed without any ChangeLog
entry. Should we just stop mentioning the HTML in the ChangeLog?

We could do something like the attached patch, but it seems overkill
for this one special case.


The change makes sense, but indeed it feels like a very specialized
case in a general script.


Yes, that was my thought too.


On the other hand, the script is just meant to enforce our policies,
not dictate them. But on the gripping hand, if the policy can't be
checked simply, maybe it's a bad policy.


Similar to "doc/html/*" I've sometimes used "testsuite/*" for changes
that affect huge numbers of files in the libstdc++ testsuite, e.g.
commit r7-2817-52066eae5d3dd6b7c0a1b843469582dbdbb941eb did:

  2911 files changed, 3072 insertions(+), 4512 deletions(-)


Nice example.



I don't want to list thousands of files at once. So maybe a general
approach for allowing wildcards in specific directories makes sense.


I tend to this approach. Let me prepare a patch candidate for it.



What will we do on January 1 2021 when Jakub updates the copyright
years in every file in the tree, turn off the hook temporarily?



We should probably add early bail out for git commits with
'Bump copyright year'. I'll help Jakub with that.

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/2/20 1:22 PM, Jonathan Wakely via Gcc-patches wrote:

On Tue, 2 Jun 2020 at 12:09, Jonathan Wakely  wrote:


On Tue, 2 Jun 2020 at 12:05, Jonathan Wakely  wrote:


On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:


On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:

The libstdc++ manual is written in Docbook XML, but we commit both the
XML and generated HTML pages to Git. Sometimes a small XML file can
result in dozens of mechanical changes to the generated HTML files,
which we record in the ChangeLog as:

 * doc/html/*: Regenerated.

With the new checks we need to name every generated file individually.

If we add that directory to the ignored_prefixes list, we won't need
to name them. But then the doc/html/* entry will give an error, and
changes to the HTML files can be committed without any ChangeLog
entry. Should we just stop mentioning the HTML in the ChangeLog?

We could do something like the attached patch, but it seems overkill
for this one special case.


The change makes sense, but indeed it feels like a very specialized
case in a general script.


Yes, that was my thought too.


On the other hand, the script is just meant to enforce our policies,
not dictate them. But on the gripping hand, if the policy can't be
checked simply, maybe it's a bad policy.


Similar to "doc/html/*" I've sometimes used "testsuite/*" for changes
that affect huge numbers of files in the libstdc++ testsuite, e.g.
commit r7-2817-52066eae5d3dd6b7c0a1b843469582dbdbb941eb did:

  2911 files changed, 3072 insertions(+), 4512 deletions(-)


Nice example.



I don't want to list thousands of files at once. So maybe a general
approach for allowing wildcards in specific directories makes sense.


I tend to this approach. Let me prepare a patch candidate for it.



What will we do on January 1 2021 when Jakub updates the copyright
years in every file in the tree, turn off the hook temporarily?



We should probably add early bail out for git commits with
'Bump copyright year'. I'll help Jakub with that.

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Jun 2020 at 12:09, Jonathan Wakely  wrote:
>
> On Tue, 2 Jun 2020 at 12:05, Jonathan Wakely  wrote:
> >
> > On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:
> > >
> > > On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> > > > The libstdc++ manual is written in Docbook XML, but we commit both the
> > > > XML and generated HTML pages to Git. Sometimes a small XML file can
> > > > result in dozens of mechanical changes to the generated HTML files,
> > > > which we record in the ChangeLog as:
> > > >
> > > > * doc/html/*: Regenerated.
> > > >
> > > > With the new checks we need to name every generated file individually.
> > > >
> > > > If we add that directory to the ignored_prefixes list, we won't need
> > > > to name them. But then the doc/html/* entry will give an error, and
> > > > changes to the HTML files can be committed without any ChangeLog
> > > > entry. Should we just stop mentioning the HTML in the ChangeLog?
> > > >
> > > > We could do something like the attached patch, but it seems overkill
> > > > for this one special case.
> > >
> > > The change makes sense, but indeed it feels like a very specialized
> > > case in a general script.
> >
> > Yes, that was my thought too.
>
> On the other hand, the script is just meant to enforce our policies,
> not dictate them. But on the gripping hand, if the policy can't be
> checked simply, maybe it's a bad policy.

Similar to "doc/html/*" I've sometimes used "testsuite/*" for changes
that affect huge numbers of files in the libstdc++ testsuite, e.g.
commit r7-2817-52066eae5d3dd6b7c0a1b843469582dbdbb941eb did:

 2911 files changed, 3072 insertions(+), 4512 deletions(-)

I don't want to list thousands of files at once. So maybe a general
approach for allowing wildcards in specific directories makes sense.

What will we do on January 1 2021 when Jakub updates the copyright
years in every file in the tree, turn off the hook temporarily?


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc
On Tue, 2 Jun 2020 at 12:09, Jonathan Wakely  wrote:
>
> On Tue, 2 Jun 2020 at 12:05, Jonathan Wakely  wrote:
> >
> > On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:
> > >
> > > On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> > > > The libstdc++ manual is written in Docbook XML, but we commit both the
> > > > XML and generated HTML pages to Git. Sometimes a small XML file can
> > > > result in dozens of mechanical changes to the generated HTML files,
> > > > which we record in the ChangeLog as:
> > > >
> > > > * doc/html/*: Regenerated.
> > > >
> > > > With the new checks we need to name every generated file individually.
> > > >
> > > > If we add that directory to the ignored_prefixes list, we won't need
> > > > to name them. But then the doc/html/* entry will give an error, and
> > > > changes to the HTML files can be committed without any ChangeLog
> > > > entry. Should we just stop mentioning the HTML in the ChangeLog?
> > > >
> > > > We could do something like the attached patch, but it seems overkill
> > > > for this one special case.
> > >
> > > The change makes sense, but indeed it feels like a very specialized
> > > case in a general script.
> >
> > Yes, that was my thought too.
>
> On the other hand, the script is just meant to enforce our policies,
> not dictate them. But on the gripping hand, if the policy can't be
> checked simply, maybe it's a bad policy.

Similar to "doc/html/*" I've sometimes used "testsuite/*" for changes
that affect huge numbers of files in the libstdc++ testsuite, e.g.
commit r7-2817-52066eae5d3dd6b7c0a1b843469582dbdbb941eb did:

 2911 files changed, 3072 insertions(+), 4512 deletions(-)

I don't want to list thousands of files at once. So maybe a general
approach for allowing wildcards in specific directories makes sense.

What will we do on January 1 2021 when Jakub updates the copyright
years in every file in the tree, turn off the hook temporarily?


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc
On Tue, 2 Jun 2020 at 12:05, Jonathan Wakely  wrote:
>
> On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:
> >
> > On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> > > The libstdc++ manual is written in Docbook XML, but we commit both the
> > > XML and generated HTML pages to Git. Sometimes a small XML file can
> > > result in dozens of mechanical changes to the generated HTML files,
> > > which we record in the ChangeLog as:
> > >
> > > * doc/html/*: Regenerated.
> > >
> > > With the new checks we need to name every generated file individually.
> > >
> > > If we add that directory to the ignored_prefixes list, we won't need
> > > to name them. But then the doc/html/* entry will give an error, and
> > > changes to the HTML files can be committed without any ChangeLog
> > > entry. Should we just stop mentioning the HTML in the ChangeLog?
> > >
> > > We could do something like the attached patch, but it seems overkill
> > > for this one special case.
> >
> > The change makes sense, but indeed it feels like a very specialized
> > case in a general script.
>
> Yes, that was my thought too.

On the other hand, the script is just meant to enforce our policies,
not dictate them. But on the gripping hand, if the policy can't be
checked simply, maybe it's a bad policy.


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Jun 2020 at 12:05, Jonathan Wakely  wrote:
>
> On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:
> >
> > On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> > > The libstdc++ manual is written in Docbook XML, but we commit both the
> > > XML and generated HTML pages to Git. Sometimes a small XML file can
> > > result in dozens of mechanical changes to the generated HTML files,
> > > which we record in the ChangeLog as:
> > >
> > > * doc/html/*: Regenerated.
> > >
> > > With the new checks we need to name every generated file individually.
> > >
> > > If we add that directory to the ignored_prefixes list, we won't need
> > > to name them. But then the doc/html/* entry will give an error, and
> > > changes to the HTML files can be committed without any ChangeLog
> > > entry. Should we just stop mentioning the HTML in the ChangeLog?
> > >
> > > We could do something like the attached patch, but it seems overkill
> > > for this one special case.
> >
> > The change makes sense, but indeed it feels like a very specialized
> > case in a general script.
>
> Yes, that was my thought too.

On the other hand, the script is just meant to enforce our policies,
not dictate them. But on the gripping hand, if the policy can't be
checked simply, maybe it's a bad policy.


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc
On Tue, 2 Jun 2020 at 07:44, Martin Liška  wrote:
>
> On 6/1/20 7:24 PM, Jonathan Wakely wrote:
> > On Mon, 25 May 2020 at 23:50, Jakub Jelinek via Gcc  wrote:
> >>
> >> Hi!
> >>
> >> I've turned the strict mode of Martin Liška's hook changes,
> >> which means that from now on no commits to the trunk or release branches
> >> should be changing any ChangeLog files together with the other files,
> >> ChangeLog entry should be solely in the commit message.
> >> The DATESTAMP bumping script will be updating the ChangeLog files for you.
> >> If somebody makes a mistake in that, please wait 24 hours (at least until
> >> after 00:16 UTC after your commit) so that the script will create the
> >> ChangeLog entries, and afterwards it can be fixed by adjusting the 
> >> ChangeLog
> >> files.  But you can only touch the ChangeLog files in that case (and
> >> shouldn't write a ChangeLog entry for that in the commit message).
> >>
> >> If anything goes wrong, please let me, other RMs and Martin Liška know.
> >
> > The libstdc++ manual is written in Docbook XML, but we commit both the
> > XML and generated HTML pages to Git. Sometimes a small XML file can
> > result in dozens of mechanical changes to the generated HTML files,
> > which we record in the ChangeLog as:
> >
> >  * doc/html/*: Regenerated.
> >
> > With the new checks we need to name every generated file individually.
> >
> > If we add that directory to the ignored_prefixes list, we won't need
> > to name them. But then the doc/html/* entry will give an error, and
> > changes to the HTML files can be committed without any ChangeLog
> > entry. Should we just stop mentioning the HTML in the ChangeLog?
> >
> > We could do something like the attached patch, but it seems overkill
> > for this one special case.
> >
>
> The patch is fine to me.
> Can you please a pytest for the situation: 
> contrib/gcc-changelog/test_email.py ?

Tests now added (and passing) for the positive case and both negative cases.
commit 21f171e1f8af7e222a87523d7957174f985a1dd5
Author: Jonathan Wakely 
Date:   Mon Jun 1 18:33:48 2020 +0100

gcc-changelog: Allow "doc/html/*" in libstdc++ changelog

contrib/ChangeLog:

* gcc-changelog/git_commit.py (check_mentioned_files): Allow
wildcard path for generated files in libstdc++-v3/doc/html.
* gcc-changelog/test_email.py (test_libstdcxx_html_regenerated):
New test.
* gcc-changelog/test_patches.txt: Add patches.

diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index b8c7f718c50..d723d890f31 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -501,6 +501,7 @@ class GitCommit:
 assert folder_count == len(self.changelog_entries)
 
 mentioned_files = set()
+libstdcxx_html_regenerated = False
 for entry in self.changelog_entries:
 if not entry.files:
 msg = 'ChangeLog must contain at least one file entry'
@@ -508,16 +509,33 @@ 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))
+file = os.path.join(entry.folder, file)
+if file == 'libstdc++-v3/doc/html/*':
+libstdcxx_html_regenerated = True
+else:
+mentioned_files.add(file)
 
 cand = [x[0] for x in self.modified_files
 if not self.is_changelog_filename(x[0])]
 changed_files = set(cand)
+if libstdcxx_html_regenerated:
+libstdcxx_html_regenerated = False
+for c in changed_files:
+if c.startswith('libstdc++-v3/doc/html/'):
+libstdcxx_html_regenerated = True
+break
+if not libstdcxx_html_regenerated:
+self.errors.append(Error('No libstdc++ HTML changes found'))
+
 for file in sorted(mentioned_files - changed_files):
 self.errors.append(Error('file not changed in a patch', file))
 for file in sorted(changed_files - mentioned_files):
 if not self.in_ignored_location(file):
-if file in self.new_files:
+if file.startswith('libstdc++-v3/doc/html/'):
+if not libstdcxx_html_regenerated:
+msg = 'libstdc++ HTML changes not in ChangeLog'
+self.errors.append(Error(msg, file))
+elif file in self.new_files:
 changelog_location = self.get_changelog_by_path(file)
 # Python2: we cannot use next(filter(...))
 entries = filter(lambda x: x.folder == changelog_location,
diff --git a/contrib/gcc-changelog/test_email.py 
b/contrib/gcc-changelog/test_email.py
index 

Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Jun 2020 at 07:44, Martin Liška  wrote:
>
> On 6/1/20 7:24 PM, Jonathan Wakely wrote:
> > On Mon, 25 May 2020 at 23:50, Jakub Jelinek via Gcc  
> > wrote:
> >>
> >> Hi!
> >>
> >> I've turned the strict mode of Martin Liška's hook changes,
> >> which means that from now on no commits to the trunk or release branches
> >> should be changing any ChangeLog files together with the other files,
> >> ChangeLog entry should be solely in the commit message.
> >> The DATESTAMP bumping script will be updating the ChangeLog files for you.
> >> If somebody makes a mistake in that, please wait 24 hours (at least until
> >> after 00:16 UTC after your commit) so that the script will create the
> >> ChangeLog entries, and afterwards it can be fixed by adjusting the 
> >> ChangeLog
> >> files.  But you can only touch the ChangeLog files in that case (and
> >> shouldn't write a ChangeLog entry for that in the commit message).
> >>
> >> If anything goes wrong, please let me, other RMs and Martin Liška know.
> >
> > The libstdc++ manual is written in Docbook XML, but we commit both the
> > XML and generated HTML pages to Git. Sometimes a small XML file can
> > result in dozens of mechanical changes to the generated HTML files,
> > which we record in the ChangeLog as:
> >
> >  * doc/html/*: Regenerated.
> >
> > With the new checks we need to name every generated file individually.
> >
> > If we add that directory to the ignored_prefixes list, we won't need
> > to name them. But then the doc/html/* entry will give an error, and
> > changes to the HTML files can be committed without any ChangeLog
> > entry. Should we just stop mentioning the HTML in the ChangeLog?
> >
> > We could do something like the attached patch, but it seems overkill
> > for this one special case.
> >
>
> The patch is fine to me.
> Can you please a pytest for the situation: 
> contrib/gcc-changelog/test_email.py ?

Tests now added (and passing) for the positive case and both negative cases.
commit 21f171e1f8af7e222a87523d7957174f985a1dd5
Author: Jonathan Wakely 
Date:   Mon Jun 1 18:33:48 2020 +0100

gcc-changelog: Allow "doc/html/*" in libstdc++ changelog

contrib/ChangeLog:

* gcc-changelog/git_commit.py (check_mentioned_files): Allow
wildcard path for generated files in libstdc++-v3/doc/html.
* gcc-changelog/test_email.py (test_libstdcxx_html_regenerated):
New test.
* gcc-changelog/test_patches.txt: Add patches.

diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index b8c7f718c50..d723d890f31 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -501,6 +501,7 @@ class GitCommit:
 assert folder_count == len(self.changelog_entries)
 
 mentioned_files = set()
+libstdcxx_html_regenerated = False
 for entry in self.changelog_entries:
 if not entry.files:
 msg = 'ChangeLog must contain at least one file entry'
@@ -508,16 +509,33 @@ 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))
+file = os.path.join(entry.folder, file)
+if file == 'libstdc++-v3/doc/html/*':
+libstdcxx_html_regenerated = True
+else:
+mentioned_files.add(file)
 
 cand = [x[0] for x in self.modified_files
 if not self.is_changelog_filename(x[0])]
 changed_files = set(cand)
+if libstdcxx_html_regenerated:
+libstdcxx_html_regenerated = False
+for c in changed_files:
+if c.startswith('libstdc++-v3/doc/html/'):
+libstdcxx_html_regenerated = True
+break
+if not libstdcxx_html_regenerated:
+self.errors.append(Error('No libstdc++ HTML changes found'))
+
 for file in sorted(mentioned_files - changed_files):
 self.errors.append(Error('file not changed in a patch', file))
 for file in sorted(changed_files - mentioned_files):
 if not self.in_ignored_location(file):
-if file in self.new_files:
+if file.startswith('libstdc++-v3/doc/html/'):
+if not libstdcxx_html_regenerated:
+msg = 'libstdc++ HTML changes not in ChangeLog'
+self.errors.append(Error(msg, file))
+elif file in self.new_files:
 changelog_location = self.get_changelog_by_path(file)
 # Python2: we cannot use next(filter(...))
 entries = filter(lambda x: x.folder == changelog_location,
diff --git a/contrib/gcc-changelog/test_email.py 
b/contrib/gcc-changelog/test_email.py

Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:
>
> On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> > The libstdc++ manual is written in Docbook XML, but we commit both the
> > XML and generated HTML pages to Git. Sometimes a small XML file can
> > result in dozens of mechanical changes to the generated HTML files,
> > which we record in the ChangeLog as:
> >
> > * doc/html/*: Regenerated.
> >
> > With the new checks we need to name every generated file individually.
> >
> > If we add that directory to the ignored_prefixes list, we won't need
> > to name them. But then the doc/html/* entry will give an error, and
> > changes to the HTML files can be committed without any ChangeLog
> > entry. Should we just stop mentioning the HTML in the ChangeLog?
> >
> > We could do something like the attached patch, but it seems overkill
> > for this one special case.
>
> The change makes sense, but indeed it feels like a very specialized
> case in a general script.

Yes, that was my thought too.

> Thinking out of the box (and admittedly with a dose of igorance, which
> means I am likely missing something): Is not keeping the libstdc++/doc
> HTML in Git a viable option?  Only creating that HTML as part of releases
> and maybe snapshots?

It gets sync'd to https://gcc.gnu.org/onlinedocs/libstdc++ nightly. We
could generate it nightly, but we'd need all the docbook stylesheets
etc. on sourceware. Or we could just generate it for snapshots (which
would still need the docbook stuff on the server) and only sync the
onlinedocs weekly from the snapshot.


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Jonathan Wakely via Gcc
On Tue, 2 Jun 2020 at 11:56, Gerald Pfeifer  wrote:
>
> On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> > The libstdc++ manual is written in Docbook XML, but we commit both the
> > XML and generated HTML pages to Git. Sometimes a small XML file can
> > result in dozens of mechanical changes to the generated HTML files,
> > which we record in the ChangeLog as:
> >
> > * doc/html/*: Regenerated.
> >
> > With the new checks we need to name every generated file individually.
> >
> > If we add that directory to the ignored_prefixes list, we won't need
> > to name them. But then the doc/html/* entry will give an error, and
> > changes to the HTML files can be committed without any ChangeLog
> > entry. Should we just stop mentioning the HTML in the ChangeLog?
> >
> > We could do something like the attached patch, but it seems overkill
> > for this one special case.
>
> The change makes sense, but indeed it feels like a very specialized
> case in a general script.

Yes, that was my thought too.

> Thinking out of the box (and admittedly with a dose of igorance, which
> means I am likely missing something): Is not keeping the libstdc++/doc
> HTML in Git a viable option?  Only creating that HTML as part of releases
> and maybe snapshots?

It gets sync'd to https://gcc.gnu.org/onlinedocs/libstdc++ nightly. We
could generate it nightly, but we'd need all the docbook stylesheets
etc. on sourceware. Or we could just generate it for snapshots (which
would still need the docbook stuff on the server) and only sync the
onlinedocs weekly from the snapshot.


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Gerald Pfeifer
On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> The libstdc++ manual is written in Docbook XML, but we commit both the
> XML and generated HTML pages to Git. Sometimes a small XML file can
> result in dozens of mechanical changes to the generated HTML files,
> which we record in the ChangeLog as:
> 
> * doc/html/*: Regenerated.
> 
> With the new checks we need to name every generated file individually.
> 
> If we add that directory to the ignored_prefixes list, we won't need
> to name them. But then the doc/html/* entry will give an error, and
> changes to the HTML files can be committed without any ChangeLog
> entry. Should we just stop mentioning the HTML in the ChangeLog?
> 
> We could do something like the attached patch, but it seems overkill
> for this one special case.

The change makes sense, but indeed it feels like a very specialized
case in a general script.

Thinking out of the box (and admittedly with a dose of igorance, which
means I am likely missing something): Is not keeping the libstdc++/doc 
HTML in Git a viable option?  Only creating that HTML as part of releases 
and maybe snapshots?

Gerald


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Gerald Pfeifer
On Mon, 1 Jun 2020, Jonathan Wakely via Gcc-patches wrote:
> The libstdc++ manual is written in Docbook XML, but we commit both the
> XML and generated HTML pages to Git. Sometimes a small XML file can
> result in dozens of mechanical changes to the generated HTML files,
> which we record in the ChangeLog as:
> 
> * doc/html/*: Regenerated.
> 
> With the new checks we need to name every generated file individually.
> 
> If we add that directory to the ignored_prefixes list, we won't need
> to name them. But then the doc/html/* entry will give an error, and
> changes to the HTML files can be committed without any ChangeLog
> entry. Should we just stop mentioning the HTML in the ChangeLog?
> 
> We could do something like the attached patch, but it seems overkill
> for this one special case.

The change makes sense, but indeed it feels like a very specialized
case in a general script.

Thinking out of the box (and admittedly with a dose of igorance, which
means I am likely missing something): Is not keeping the libstdc++/doc 
HTML in Git a viable option?  Only creating that HTML as part of releases 
and maybe snapshots?

Gerald


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/1/20 7:24 PM, Jonathan Wakely wrote:

On Mon, 25 May 2020 at 23:50, Jakub Jelinek via Gcc  wrote:


Hi!

I've turned the strict mode of Martin Liška's hook changes,
which means that from now on no commits to the trunk or release branches
should be changing any ChangeLog files together with the other files,
ChangeLog entry should be solely in the commit message.
The DATESTAMP bumping script will be updating the ChangeLog files for you.
If somebody makes a mistake in that, please wait 24 hours (at least until
after 00:16 UTC after your commit) so that the script will create the
ChangeLog entries, and afterwards it can be fixed by adjusting the ChangeLog
files.  But you can only touch the ChangeLog files in that case (and
shouldn't write a ChangeLog entry for that in the commit message).

If anything goes wrong, please let me, other RMs and Martin Liška know.


The libstdc++ manual is written in Docbook XML, but we commit both the
XML and generated HTML pages to Git. Sometimes a small XML file can
result in dozens of mechanical changes to the generated HTML files,
which we record in the ChangeLog as:

 * doc/html/*: Regenerated.

With the new checks we need to name every generated file individually.

If we add that directory to the ignored_prefixes list, we won't need
to name them. But then the doc/html/* entry will give an error, and
changes to the HTML files can be committed without any ChangeLog
entry. Should we just stop mentioning the HTML in the ChangeLog?

We could do something like the attached patch, but it seems overkill
for this one special case.



The patch is fine to me.
Can you please a pytest for the situation: contrib/gcc-changelog/test_email.py ?

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-06-02 Thread Martin Liška

On 6/1/20 7:24 PM, Jonathan Wakely wrote:

On Mon, 25 May 2020 at 23:50, Jakub Jelinek via Gcc  wrote:


Hi!

I've turned the strict mode of Martin Liška's hook changes,
which means that from now on no commits to the trunk or release branches
should be changing any ChangeLog files together with the other files,
ChangeLog entry should be solely in the commit message.
The DATESTAMP bumping script will be updating the ChangeLog files for you.
If somebody makes a mistake in that, please wait 24 hours (at least until
after 00:16 UTC after your commit) so that the script will create the
ChangeLog entries, and afterwards it can be fixed by adjusting the ChangeLog
files.  But you can only touch the ChangeLog files in that case (and
shouldn't write a ChangeLog entry for that in the commit message).

If anything goes wrong, please let me, other RMs and Martin Liška know.


The libstdc++ manual is written in Docbook XML, but we commit both the
XML and generated HTML pages to Git. Sometimes a small XML file can
result in dozens of mechanical changes to the generated HTML files,
which we record in the ChangeLog as:

 * doc/html/*: Regenerated.

With the new checks we need to name every generated file individually.

If we add that directory to the ignored_prefixes list, we won't need
to name them. But then the doc/html/* entry will give an error, and
changes to the HTML files can be committed without any ChangeLog
entry. Should we just stop mentioning the HTML in the ChangeLog?

We could do something like the attached patch, but it seems overkill
for this one special case.



The patch is fine to me.
Can you please a pytest for the situation: contrib/gcc-changelog/test_email.py ?

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-06-01 Thread Jonathan Wakely via Gcc
On Mon, 25 May 2020 at 23:50, Jakub Jelinek via Gcc  wrote:
>
> Hi!
>
> I've turned the strict mode of Martin Liška's hook changes,
> which means that from now on no commits to the trunk or release branches
> should be changing any ChangeLog files together with the other files,
> ChangeLog entry should be solely in the commit message.
> The DATESTAMP bumping script will be updating the ChangeLog files for you.
> If somebody makes a mistake in that, please wait 24 hours (at least until
> after 00:16 UTC after your commit) so that the script will create the
> ChangeLog entries, and afterwards it can be fixed by adjusting the ChangeLog
> files.  But you can only touch the ChangeLog files in that case (and
> shouldn't write a ChangeLog entry for that in the commit message).
>
> If anything goes wrong, please let me, other RMs and Martin Liška know.

The libstdc++ manual is written in Docbook XML, but we commit both the
XML and generated HTML pages to Git. Sometimes a small XML file can
result in dozens of mechanical changes to the generated HTML files,
which we record in the ChangeLog as:

* doc/html/*: Regenerated.

With the new checks we need to name every generated file individually.

If we add that directory to the ignored_prefixes list, we won't need
to name them. But then the doc/html/* entry will give an error, and
changes to the HTML files can be committed without any ChangeLog
entry. Should we just stop mentioning the HTML in the ChangeLog?

We could do something like the attached patch, but it seems overkill
for this one special case.
diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index 4f82b58f64b..add0defaeed 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -501,6 +501,7 @@ class GitCommit:
 assert folder_count == len(self.changelog_entries)
 
 mentioned_files = set()
+libstdcxx_html_regenerated = False
 for entry in self.changelog_entries:
 if not entry.files:
 msg = 'ChangeLog must contain a file entry'
@@ -508,16 +509,33 @@ 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))
+file = os.path.join(entry.folder, file)
+if file == 'libstdc++-v3/doc/html/*':
+libstdcxx_html_regenerated = True
+else:
+mentioned_files.add(file)
 
 cand = [x[0] for x in self.modified_files
 if not self.is_changelog_filename(x[0])]
 changed_files = set(cand)
+if libstdcxx_html_regenerated:
+libstdcxx_html_regenerated = False
+for c in changed_files:
+if c.startswith('libstdc++-v3/doc/html/'):
+libstdcxx_html_regenerated = True
+break
+if not libstdcxx_html_regenerated:
+self.errors.append(Error('No libstdc++ HTML changes found'))
+
 for file in sorted(mentioned_files - changed_files):
 self.errors.append(Error('file not changed in a patch', file))
 for file in sorted(changed_files - mentioned_files):
 if not self.in_ignored_location(file):
-if file in self.new_files:
+if file.startswith('libstdc++-v3/doc/html/'):
+if not libstdcxx_html_regenerated:
+msg = 'libstdc++ HTML changes not in ChangeLog'
+self.errors.append(Error(msg, file))
+elif file in self.new_files:
 changelog_location = self.get_changelog_by_path(file)
 # Python2: we cannot use next(filter(...))
 entries = filter(lambda x: x.folder == changelog_location,


Re: [IMPORTANT] ChangeLog related changes

2020-06-01 Thread Jonathan Wakely via Gcc-patches
On Mon, 25 May 2020 at 23:50, Jakub Jelinek via Gcc  wrote:
>
> Hi!
>
> I've turned the strict mode of Martin Liška's hook changes,
> which means that from now on no commits to the trunk or release branches
> should be changing any ChangeLog files together with the other files,
> ChangeLog entry should be solely in the commit message.
> The DATESTAMP bumping script will be updating the ChangeLog files for you.
> If somebody makes a mistake in that, please wait 24 hours (at least until
> after 00:16 UTC after your commit) so that the script will create the
> ChangeLog entries, and afterwards it can be fixed by adjusting the ChangeLog
> files.  But you can only touch the ChangeLog files in that case (and
> shouldn't write a ChangeLog entry for that in the commit message).
>
> If anything goes wrong, please let me, other RMs and Martin Liška know.

The libstdc++ manual is written in Docbook XML, but we commit both the
XML and generated HTML pages to Git. Sometimes a small XML file can
result in dozens of mechanical changes to the generated HTML files,
which we record in the ChangeLog as:

* doc/html/*: Regenerated.

With the new checks we need to name every generated file individually.

If we add that directory to the ignored_prefixes list, we won't need
to name them. But then the doc/html/* entry will give an error, and
changes to the HTML files can be committed without any ChangeLog
entry. Should we just stop mentioning the HTML in the ChangeLog?

We could do something like the attached patch, but it seems overkill
for this one special case.
diff --git a/contrib/gcc-changelog/git_commit.py 
b/contrib/gcc-changelog/git_commit.py
index 4f82b58f64b..add0defaeed 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -501,6 +501,7 @@ class GitCommit:
 assert folder_count == len(self.changelog_entries)
 
 mentioned_files = set()
+libstdcxx_html_regenerated = False
 for entry in self.changelog_entries:
 if not entry.files:
 msg = 'ChangeLog must contain a file entry'
@@ -508,16 +509,33 @@ 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))
+file = os.path.join(entry.folder, file)
+if file == 'libstdc++-v3/doc/html/*':
+libstdcxx_html_regenerated = True
+else:
+mentioned_files.add(file)
 
 cand = [x[0] for x in self.modified_files
 if not self.is_changelog_filename(x[0])]
 changed_files = set(cand)
+if libstdcxx_html_regenerated:
+libstdcxx_html_regenerated = False
+for c in changed_files:
+if c.startswith('libstdc++-v3/doc/html/'):
+libstdcxx_html_regenerated = True
+break
+if not libstdcxx_html_regenerated:
+self.errors.append(Error('No libstdc++ HTML changes found'))
+
 for file in sorted(mentioned_files - changed_files):
 self.errors.append(Error('file not changed in a patch', file))
 for file in sorted(changed_files - mentioned_files):
 if not self.in_ignored_location(file):
-if file in self.new_files:
+if file.startswith('libstdc++-v3/doc/html/'):
+if not libstdcxx_html_regenerated:
+msg = 'libstdc++ HTML changes not in ChangeLog'
+self.errors.append(Error(msg, file))
+elif file in self.new_files:
 changelog_location = self.get_changelog_by_path(file)
 # Python2: we cannot use next(filter(...))
 entries = filter(lambda x: x.folder == changelog_location,


Re: [IMPORTANT] ChangeLog related changes

2020-06-01 Thread Martin Liška

On 5/31/20 10:27 PM, Segher Boessenkool wrote:

On Tue, May 26, 2020 at 03:14:02PM +0200, Andreas Schwab wrote:

On Mai 26 2020, Martin Liška wrote:


 subprocess.check_output('git show --name-only --pretty="" | '
 'grep ChangeLog | '


git show --name-only --pretty= -- '*ChangeLog*'


Or even just

git checkout HEAD $(git show --name-only --pretty= -- '*ChangeLog*')


I like it!

For now, I'm not going to adjust the script.

Martin



after you did any such attempted backport that touched changelogs, and
you should be good to go.

(This is also easy to do manually).


Segher





Re: [IMPORTANT] ChangeLog related changes

2020-05-31 Thread Segher Boessenkool
On Tue, May 26, 2020 at 03:14:02PM +0200, Andreas Schwab wrote:
> On Mai 26 2020, Martin Liška wrote:
> 
> > subprocess.check_output('git show --name-only --pretty="" | '
> > 'grep ChangeLog | '
> 
> git show --name-only --pretty= -- '*ChangeLog*'

Or even just

git checkout HEAD $(git show --name-only --pretty= -- '*ChangeLog*')

after you did any such attempted backport that touched changelogs, and
you should be good to go.

(This is also easy to do manually).


Segher


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Thomas Koenig via Gcc

Hi Jakub,


On Tue, May 26, 2020 at 12:42:41PM +0200, Thomas Koenig wrote:



So, two questions:

- How do I get my gcc-10 branch back into a consistent state?


That works, thanks.


git reset --hard origin/releases/gcc-10
should do it (if you want to throw all your local changes).


- How are backports supposed to be handled using the new scripts?


When cherry-picking or otherwise backporting a change which changed the
ChangeLog files, one needs to remove the ChangeLog changes from that commit,
e.g.
git diff > /tmp/P
for i in `lsdiff /tmp/P | grep ChangeLog`; do filterdiff -i $i /tmp/P; done | 
patch -p1 -R
git commit -a --amend


I tried that, with the slight variation of doing "git diff HEAD~1 > /tmp/P"
as the first command (and installing lsdiff), and it seems I have
successfully pushed r10-8187-g3633bc27f5925394ccc5dd56bb1c65b4d88b42c0 .

Thanks!

Just to let other people know that this works :-)

Regards

Thomas


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Martin Liška

On 5/26/20 3:14 PM, Andreas Schwab wrote:

-- '*ChangeLog*'


Thank you for the comment.

There's a proper patch for 'git gcc-backport' alias.

Thoughts?
Martin
>From a1511dd6ccda73befe3282c43671a6c4623d5d7d Mon Sep 17 00:00:00 2001
From: Martin Liska 
Date: Tue, 26 May 2020 15:32:32 +0200
Subject: [PATCH] Add new git-backport.py script.

contrib/ChangeLog:

	* gcc-git-customization.sh: Use git-backport.py to drop
	all changes for ChangeLog files.
	* git-backport.py: New file.
---
 contrib/gcc-git-customization.sh |  2 +-
 contrib/git-backport.py  | 60 
 2 files changed, 61 insertions(+), 1 deletion(-)
 create mode 100755 contrib/git-backport.py

diff --git a/contrib/gcc-git-customization.sh b/contrib/gcc-git-customization.sh
index dcc42683fa6..6df881ac955 100755
--- a/contrib/gcc-git-customization.sh
+++ b/contrib/gcc-git-customization.sh
@@ -26,7 +26,7 @@ git config alias.gcc-descr \!"f() { if test \${1:-no} = --full; then c=\${2:-mas
 git config alias.gcc-undescr \!"f() { o=\$(git config --get gcc-config.upstream); r=\$(echo \$1 | sed -n 's,^r\\([0-9]\\+\\)-[0-9]\\+\$,\\1,p'); n=\$(echo \$1 | sed -n 's,^r[0-9]\\+-\\([0-9]\\+\\)\$,\\1,p'); test -z \$r && echo Invalid id \$1 && exit 1; h=\$(git rev-parse --verify --quiet \${o:-origin}/releases/gcc-\$r); test -z \$h && h=\$(git rev-parse --verify --quiet \${o:-origin}/master); p=\$(git describe --all --match 'basepoints/gcc-'\$r \$h | sed -n 's,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+-\\([0-9]\\+\\)-g[0-9a-f]*\$,\\2,p;s,^\\(tags/\\)\\?basepoints/gcc-[0-9]\\+\$,0,p'); git rev-parse --verify \$h~\$(expr \$p - \$n); }; f"
 
 git config alias.gcc-verify '!f() { "`git rev-parse --show-toplevel`/contrib/gcc-changelog/git_check_commit.py" $@; } ; f'
-git config alias.gcc-backport '!f() { rev=$1; git cherry-pick -x $@; } ; f'
+git config alias.gcc-backport '!f() { "`git rev-parse --show-toplevel`/contrib/git-backport.py" $@; } ; f'
 
 git config alias.gcc-mklog '!f() { "`git rev-parse --show-toplevel`/contrib/mklog.py" $@; } ; f'
 
diff --git a/contrib/git-backport.py b/contrib/git-backport.py
new file mode 100755
index 000..6a115c34d40
--- /dev/null
+++ b/contrib/git-backport.py
@@ -0,0 +1,60 @@
+#!/usr/bin/env python3
+
+# Copyright (C) 2020 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# GCC is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GCC; see the file COPYING.  If not, write to
+# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.
+
+import argparse
+import subprocess
+
+if __name__ == '__main__':
+parser = argparse.ArgumentParser(description='Backport a git revision and '
+ 'stash all ChangeLog files.')
+parser.add_argument('revision', help='Revision')
+args = parser.parse_args()
+
+r = subprocess.run('git cherry-pick -x %s' % args.revision, shell=True)
+if r.returncode == 0:
+cmd = 'git show --name-only --pretty="" -- "*ChangeLog" |' \
+  'xargs git checkout HEAD~'
+subprocess.check_output(cmd, shell=True)
+subprocess.check_output('git commit --amend --no-edit', shell=True)
+else:
+# 1) remove all ChangeLog files from conflicts
+out = subprocess.check_output('git diff --name-only --diff-filter=U',
+  shell=True,
+  encoding='utf8')
+conflicts = out.strip().split('\n')
+changelogs = [c for c in conflicts if c.endswith('ChangeLog')]
+if changelogs:
+cmd = 'git checkout --theirs %s' % '\n'.join(changelogs)
+subprocess.check_output(cmd, shell=True)
+# 2) remove all ChangeLog files from index
+cmd = 'git diff --name-only --diff-filter=M HEAD'
+out = subprocess.check_output(cmd, shell=True, encoding='utf8')
+out = out.strip().split('\n')
+modified = [c for c in out if c.endswith('ChangeLog')]
+for m in modified:
+subprocess.check_output('git reset %s' % m, shell=True)
+subprocess.check_output('git checkout %s' % m, shell=True)
+
+# try to continue
+if len(conflicts) == len(changelogs):
+subprocess.check_output('git cherry-pick --continue', shell=True)
+else:
+print('Please resolve all remaining file conflicts.')
-- 
2.26.2



Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Andreas Schwab
On Mai 26 2020, Martin Liška wrote:

> subprocess.check_output('git show --name-only --pretty="" | '
> 'grep ChangeLog | '

git show --name-only --pretty= -- '*ChangeLog*'

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Martin Liška

On 5/26/20 1:34 PM, Jakub Jelinek via Gcc wrote:

On Tue, May 26, 2020 at 12:27:59PM +0100, Richard Earnshaw wrote:

I haven't investigated in detail, but could we use a merge strategy with
the cherry-pick to drop ChangeLog entries?


If that works, sure.
Note, when cherry-picking commits from before conversion to git or whenever
people started to write usable ChangeLog entries in the commit messages,
one will also need to reconstruct the commit message additions from the
ChangeLog files.

Jakub



Hi.

There's a script candidate that does git cherry-pick and drops
and ChangeLog changes from both index and conflicting files.

Thoughts?
Martin
#!/usr/bin/env python3

# Copyright (C) 2020 Free Software Foundation, Inc.
#
# This file is part of GCC.
#
# GCC is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GCC is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GCC; see the file COPYING.  If not, write to
# the Free Software Foundation, 51 Franklin Street, Fifth Floor,
# Boston, MA 02110-1301, USA.

import argparse
import subprocess

if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Backport a git revision and '
 'stash all ChangeLog files.')
parser.add_argument('revision', help='Revision')
args = parser.parse_args()

r = subprocess.run('git cherry-pick -x %s' % args.revision, shell=True)
if r.returncode == 0:
subprocess.check_output('git show --name-only --pretty="" | '
'grep ChangeLog | '
'xargs git checkout HEAD~', shell=True)
subprocess.check_output('git commit --amend --no-edit', shell=True)
else:
# 1) remove all ChangeLog files from conflicts
out = subprocess.check_output('git diff --name-only --diff-filter=U',
  shell=True,
  encoding='utf8')
conflicts = out.strip().split('\n')
changelogs = [c for c in conflicts if c.endswith('ChangeLog')]
if changelogs:
cmd = 'git checkout --theirs %s' % '\n'.join(changelogs)
subprocess.check_output(cmd, shell=True)
# 2) remove all ChangeLog files from index
out = subprocess.check_output('git diff --name-only --diff-filter=M HEAD',
  shell=True,
  encoding='utf8')
out = out.strip().split('\n')
modified = [c for c in out if c.endswith('ChangeLog')]
for m in modified:
subprocess.check_output('git reset %s' % m, shell=True)
subprocess.check_output('git checkout %s' % m, shell=True)
 
# try to continue
if len(conflicts) == len(changelogs):
subprocess.check_output('git cherry-pick --continue', shell=True)
else:
print('Please resolve all remaining file conflicts.')


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Jakub Jelinek via Gcc
On Tue, May 26, 2020 at 12:27:59PM +0100, Richard Earnshaw wrote:
> I haven't investigated in detail, but could we use a merge strategy with
> the cherry-pick to drop ChangeLog entries?

If that works, sure.
Note, when cherry-picking commits from before conversion to git or whenever
people started to write usable ChangeLog entries in the commit messages,
one will also need to reconstruct the commit message additions from the
ChangeLog files.

Jakub



Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Richard Earnshaw
On 26/05/2020 12:19, Jakub Jelinek via Gcc wrote:
> On Tue, May 26, 2020 at 12:42:41PM +0200, Thomas Koenig wrote:
>> Am 26.05.20 um 11:04 schrieb Thomas Koenig via Gcc:
>>> Am 26.05.20 um 00:48 schrieb Jakub Jelinek via Gcc:
>>>
 I've turned the strict mode of Martin Liška's hook changes,
>>>
>>> This means that it is no longer possible to do a git gcc-backport
>>
>> [CC'ing fortran to warn other people against currently trying
>> backports]
>>
>> ... and now I've tried to revert the ChangeLog files manually,
>> pulled again, tried to push again, and got
>>
>> remote: *** ChangeLog format failed:
>> remote: ERR: ChangeLog, DATESTAMP, BASE-VER and DEV-PHASE updates should be
>> done separately from normal commits
>> remote:
>> remote: Please see: https://gcc.gnu.org/codingconventions.html#ChangeLogs
>> remote:
>> remote: error: hook declined to update refs/heads/releases/gcc-10
>> To git+ssh://gcc.gnu.org/git/gcc.git
>>  ! [remote rejected] releases/gcc-10 -> releases/gcc-10 (hook
>> declined)
>> error: Fehler beim Versenden einiger Referenzen nach
>> 'git+ssh://tkoe...@gcc.gnu.org/git/gcc.git'
>>
>> So, I am in the quite familiar situation of a somehow inconsistent
>> state of git that I have no idea how to get out of.
>>
>> So, two questions:
>>
>> - How do I get my gcc-10 branch back into a consistent state?
> 
> git reset --hard origin/releases/gcc-10
> should do it (if you want to throw all your local changes).
> 
>> - How are backports supposed to be handled using the new scripts?
> 
> When cherry-picking or otherwise backporting a change which changed the
> ChangeLog files, one needs to remove the ChangeLog changes from that commit,
> e.g.
> git diff > /tmp/P
> for i in `lsdiff /tmp/P | grep ChangeLog`; do filterdiff -i $i /tmp/P; done | 
> patch -p1 -R
> git commit -a --amend
> or
> git checkout HEAD^ -- `git diff | lsdiff | sed -n -e 
> 's,^[ab]/\(.*/ChangeLog\)$,\1,p'`
> git commit -a --amend
> could do that.  If it is cherry-pick of an even older commit that doesn't 
> have the
> commit message with properly formatted ChangeLog entry the scripts will
> understand, one needs to change the commit message too.
> 
> Note, this obstackle will go away once you start backporting patches
> committed today or later, as those will not have the ChangeLog changes and
> will have properly formatted commit message.
> 
>   Jakub
> 

I haven't investigated in detail, but could we use a merge strategy with
the cherry-pick to drop ChangeLog entries?

R.


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Jakub Jelinek via Gcc
On Tue, May 26, 2020 at 12:42:41PM +0200, Thomas Koenig wrote:
> Am 26.05.20 um 11:04 schrieb Thomas Koenig via Gcc:
> > Am 26.05.20 um 00:48 schrieb Jakub Jelinek via Gcc:
> > 
> > > I've turned the strict mode of Martin Liška's hook changes,
> > 
> > This means that it is no longer possible to do a git gcc-backport
> 
> [CC'ing fortran to warn other people against currently trying
> backports]
> 
> ... and now I've tried to revert the ChangeLog files manually,
> pulled again, tried to push again, and got
> 
> remote: *** ChangeLog format failed:
> remote: ERR: ChangeLog, DATESTAMP, BASE-VER and DEV-PHASE updates should be
> done separately from normal commits
> remote:
> remote: Please see: https://gcc.gnu.org/codingconventions.html#ChangeLogs
> remote:
> remote: error: hook declined to update refs/heads/releases/gcc-10
> To git+ssh://gcc.gnu.org/git/gcc.git
>  ! [remote rejected] releases/gcc-10 -> releases/gcc-10 (hook
> declined)
> error: Fehler beim Versenden einiger Referenzen nach
> 'git+ssh://tkoe...@gcc.gnu.org/git/gcc.git'
> 
> So, I am in the quite familiar situation of a somehow inconsistent
> state of git that I have no idea how to get out of.
> 
> So, two questions:
> 
> - How do I get my gcc-10 branch back into a consistent state?

git reset --hard origin/releases/gcc-10
should do it (if you want to throw all your local changes).

> - How are backports supposed to be handled using the new scripts?

When cherry-picking or otherwise backporting a change which changed the
ChangeLog files, one needs to remove the ChangeLog changes from that commit,
e.g.
git diff > /tmp/P
for i in `lsdiff /tmp/P | grep ChangeLog`; do filterdiff -i $i /tmp/P; done | 
patch -p1 -R
git commit -a --amend
or
git checkout HEAD^ -- `git diff | lsdiff | sed -n -e 
's,^[ab]/\(.*/ChangeLog\)$,\1,p'`
git commit -a --amend
could do that.  If it is cherry-pick of an even older commit that doesn't have 
the
commit message with properly formatted ChangeLog entry the scripts will
understand, one needs to change the commit message too.

Note, this obstackle will go away once you start backporting patches
committed today or later, as those will not have the ChangeLog changes and
will have properly formatted commit message.

Jakub



Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Thomas Koenig via Gcc

Am 26.05.20 um 11:04 schrieb Thomas Koenig via Gcc:

Am 26.05.20 um 00:48 schrieb Jakub Jelinek via Gcc:


I've turned the strict mode of Martin Liška's hook changes,


This means that it is no longer possible to do a git gcc-backport


[CC'ing fortran to warn other people against currently trying
backports]

... and now I've tried to revert the ChangeLog files manually,
pulled again, tried to push again, and got

remote: *** ChangeLog format failed:
remote: ERR: ChangeLog, DATESTAMP, BASE-VER and DEV-PHASE updates should 
be done separately from normal commits

remote:
remote: Please see: https://gcc.gnu.org/codingconventions.html#ChangeLogs
remote:
remote: error: hook declined to update refs/heads/releases/gcc-10
To git+ssh://gcc.gnu.org/git/gcc.git
 ! [remote rejected] releases/gcc-10 -> releases/gcc-10 (hook 
declined)
error: Fehler beim Versenden einiger Referenzen nach 
'git+ssh://tkoe...@gcc.gnu.org/git/gcc.git'


So, I am in the quite familiar situation of a somehow inconsistent
state of git that I have no idea how to get out of.

So, two questions:

- How do I get my gcc-10 branch back into a consistent state?

- How are backports supposed to be handled using the new scripts?

Regards

Thomas


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Thomas Koenig via Gcc

Am 26.05.20 um 00:48 schrieb Jakub Jelinek via Gcc:


I've turned the strict mode of Martin Liška's hook changes,


This means that it is no longer possible to do a git gcc-backport
followed by a git push.  If there is a procedure for this, it
is not documented on https://gcc.gnu.org/gitwrite.html .

Please document this, or (even more preferred) automate the process
so that git gcc-backport does not touch the ChangeLog files.

Regards

Thomas

$ git gcc-backport r11-588-g8df7ee67f6fdc780e9453f2baa8d1bf62c000761
automatischer Merge von libgomp/ChangeLog
automatischer Merge von libgfortran/ChangeLog
automatischer Merge von gcc/fortran/ChangeLog
[releases/gcc-10 bb55bfe5871] Fixes a hang on an invalid ID in a WAIT 
statement.

 Date: Sat May 23 19:01:43 2020 +0200
 7 files changed, 50 insertions(+)
 create mode 100644 libgomp/testsuite/libgomp.fortran/async_io_9.f90
$ git push
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "de_DE.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Objekte aufzählen: 31, Fertig.
Zähle Objekte: 100% (31/31), Fertig.
Delta-Kompression verwendet bis zu 16 Threads.
Komprimiere Objekte: 100% (17/17), Fertig.
Schreibe Objekte: 100% (17/17), 3.93 KiB | 3.93 MiB/s, Fertig.
Gesamt 17 (Delta 14), Wiederverwendet 0 (Delta 0), Pack wiederverwendet 0
remote: *** ChangeLog format failed:
remote: ERR: ChangeLog, DATESTAMP, BASE-VER and DEV-PHASE updates should 
be done separately from normal commits

remote:
remote: Please see: https://gcc.gnu.org/codingconventions.html#ChangeLogs
remote:
remote: error: hook declined to update refs/heads/releases/gcc-10
To git+ssh://gcc.gnu.org/git/gcc.git
 ! [remote rejected] releases/gcc-10 -> releases/gcc-10 (hook 
declined)
error: Fehler beim Versenden einiger Referenzen nach 
'git+ssh://tkoe...@gcc.gnu.org/git/gcc.git'




which means that from now on no commits to the trunk or release branches
should be changing any ChangeLog files together with the other files,
ChangeLog entry should be solely in the commit message.
The DATESTAMP bumping script will be updating the ChangeLog files for you.
If somebody makes a mistake in that, please wait 24 hours (at least until
after 00:16 UTC after your commit) so that the script will create the
ChangeLog entries, and afterwards it can be fixed by adjusting the ChangeLog
files.  But you can only touch the ChangeLog files in that case (and
shouldn't write a ChangeLog entry for that in the commit message).

If anything goes wrong, please let me, other RMs and Martin Liška know.

Jakub





Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Hongtao Liu via Gcc
Great, thanks!

On Tue, May 26, 2020 at 2:08 PM Martin Liška  wrote:
>
> On 5/26/20 7:22 AM, Hongtao Liu via Gcc wrote:
> > i commit a separate patch alone only for ChangeLog files, should i revert 
> > it?
>
> Hello.
>
> I've just done it.
>
> Martin



-- 
BR,
Hongtao


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Hongtao Liu via Gcc-patches
Great, thanks!

On Tue, May 26, 2020 at 2:08 PM Martin Liška  wrote:
>
> On 5/26/20 7:22 AM, Hongtao Liu via Gcc wrote:
> > i commit a separate patch alone only for ChangeLog files, should i revert 
> > it?
>
> Hello.
>
> I've just done it.
>
> Martin



-- 
BR,
Hongtao


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Martin Liška

On 5/26/20 7:22 AM, Hongtao Liu via Gcc wrote:

i commit a separate patch alone only for ChangeLog files, should i revert it?


Hello.

I've just done it.

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-05-26 Thread Martin Liška

On 5/26/20 7:22 AM, Hongtao Liu via Gcc wrote:

i commit a separate patch alone only for ChangeLog files, should i revert it?


Hello.

I've just done it.

Martin


Re: [IMPORTANT] ChangeLog related changes

2020-05-25 Thread Hongtao Liu via Gcc
On Tue, May 26, 2020 at 6:49 AM Jakub Jelinek via Gcc-patches
 wrote:
>
> Hi!
>
> I've turned the strict mode of Martin Liška's hook changes,
> which means that from now on no commits to the trunk or release branches
> should be changing any ChangeLog files together with the other files,
> ChangeLog entry should be solely in the commit message.
> The DATESTAMP bumping script will be updating the ChangeLog files for you.
Oh, no wonder my patch was rejected by git hook with error message
---
ChangeLog files, DATESTAMP, BASE-VER and DEV-PHASE can be modified
only separately from other files
---
> If somebody makes a mistake in that, please wait 24 hours (at least until
i commit a separate patch alone only for ChangeLog files, should i revert it?
> after 00:16 UTC after your commit) so that the script will create the
> ChangeLog entries, and afterwards it can be fixed by adjusting the ChangeLog
> files.  But you can only touch the ChangeLog files in that case (and
> shouldn't write a ChangeLog entry for that in the commit message).
>
> If anything goes wrong, please let me, other RMs and Martin Liška know.
>
> Jakub
>

-- 
BR,
Hongtao


Re: [IMPORTANT] ChangeLog related changes

2020-05-25 Thread Hongtao Liu via Gcc-patches
On Tue, May 26, 2020 at 6:49 AM Jakub Jelinek via Gcc-patches
 wrote:
>
> Hi!
>
> I've turned the strict mode of Martin Liška's hook changes,
> which means that from now on no commits to the trunk or release branches
> should be changing any ChangeLog files together with the other files,
> ChangeLog entry should be solely in the commit message.
> The DATESTAMP bumping script will be updating the ChangeLog files for you.
Oh, no wonder my patch was rejected by git hook with error message
---
ChangeLog files, DATESTAMP, BASE-VER and DEV-PHASE can be modified
only separately from other files
---
> If somebody makes a mistake in that, please wait 24 hours (at least until
i commit a separate patch alone only for ChangeLog files, should i revert it?
> after 00:16 UTC after your commit) so that the script will create the
> ChangeLog entries, and afterwards it can be fixed by adjusting the ChangeLog
> files.  But you can only touch the ChangeLog files in that case (and
> shouldn't write a ChangeLog entry for that in the commit message).
>
> If anything goes wrong, please let me, other RMs and Martin Liška know.
>
> Jakub
>

-- 
BR,
Hongtao