public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>,
	"Martin Liška" <mliska@suse.cz>
Subject: Re: [IMPORTANT] ChangeLog related changes
Date: Mon, 1 Jun 2020 18:24:02 +0100	[thread overview]
Message-ID: <CAH6eHdRHmuHom9tF6NUDQAzApRH=EqwzY8QLvj4ODZDyPgU7=Q@mail.gmail.com> (raw)
In-Reply-To: <20200525224858.GO8462@tucnak>

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

On Mon, 25 May 2020 at 23:50, Jakub Jelinek via Gcc <gcc@gcc.gnu.org> 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.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 2399 bytes --]

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,

  parent reply	other threads:[~2020-06-01 17:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25 22:48 Jakub Jelinek
2020-05-26  5:22 ` Hongtao Liu
2020-05-26  6:08   ` Martin Liška
2020-05-26  6:10     ` Hongtao Liu
2020-06-01 17:24 ` Jonathan Wakely [this message]
2020-06-02  6:44   ` Martin Liška
2020-06-02 11:06     ` Jonathan Wakely
2020-06-02 10:55   ` Gerald Pfeifer
2020-06-02 11:05     ` Jonathan Wakely
2020-06-02 11:09       ` Jonathan Wakely
2020-06-02 11:22         ` Jonathan Wakely
2020-06-02 11:48           ` Martin Liška
2020-06-02 13:16             ` Martin Liška
2020-06-02 13:56               ` Jonathan Wakely
2020-06-02 14:06                 ` Martin Liška
2020-06-02 14:14                 ` Jonathan Wakely
2020-06-02 14:25                   ` Martin Liška
2020-06-09 20:29                     ` Jonathan Wakely
2020-06-10  7:37                       ` Martin Liška
2020-06-10 13:34                         ` Tamar Christina
2020-06-10 13:39                           ` Marek Polacek
2020-06-10 13:41                           ` Martin Liška
2020-06-10 14:53                             ` Tamar Christina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH6eHdRHmuHom9tF6NUDQAzApRH=EqwzY8QLvj4ODZDyPgU7=Q@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=gcc@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=mliska@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).