public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: Jonathan Wakely <jwakely@redhat.com>,
	libstdc++ <libstdc++@gcc.gnu.org>,
	gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] gcc-changelog: Add libstdc++-v3/testsuite to wildcard prefixes
Date: Mon, 30 Nov 2020 13:43:29 +0100	[thread overview]
Message-ID: <aa18ed1c-1cac-e707-8869-f6b66266c341@suse.cz> (raw)
In-Reply-To: <CAH6eHdTOTU1SDyYVh7BVz3ZZdjf0XQyghgqAQg=_6A+CiqoG9A@mail.gmail.com>

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

On 11/30/20 1:23 PM, Jonathan Wakely wrote:
> On Mon, 30 Nov 2020 at 12:14, Martin Liška <mliska@suse.cz> wrote:
>>
>> On 11/30/20 12:58 PM, Jonathan Wakely wrote:
>>> I can have a commit which only uses wildcards now, thanks.
>>
>> Good!
>>
>>>
>>> I still can't use sub-directories with wildcards, but I can live with that.
>>
>> Why? The example I presented did so:
>>
>> libstdc++-v3/ChangeLog:
>>          * doc/html/*: All you need is love.
>>
>> and I modified the following file:
>> libstdc++-v3/doc/html/manual/debug.html | 3 ++-
>>
>> Isn't that a sub-directory?
> 
> But libstdc++/doc/html is the entry in the wildcard_prefixes list.
> What I mean is using a sub-directory in the changelog:
> 
>    * doc/html/manual/*: Love is all you need.
> 
> The use case is for subsets of the testsuite. I've added
> libstdc++-v3/testsuite to the wildcard_prefixes, which means I can now
> do this:
> 
>   * testsuite/*: Update all 28_regex tests.
> 
> But I would like to do this:
> 
>   * testsuite/28_regex/*: Update all tests.

Ahh, got it. Fix with the attached patch I've just pushed.

Hope it's fine now?
Martin

> 
> The concrete use case is:
> 
> * testsuite/20_util/specialized_algorithms/pstl/*: Add dg-timeout-factor.
> * testsuite/25_algorithms/pstl/*: Likewise.
> * testsuite/26_numerics/pstl/*: Likewise.
> * testsuite/28_regex/*: Likewise.
> 
> I'm modifying four specific sub-directories, so I'd like to say that
> in the changelog. Currently to allow that I'd have to add every
> directory under libstdc++-v3/testsuite to the wildcard_prefixes (which
> doesn't scale) or just be vague instead of saying which
> sub-directories are affected:
> 
> * testsuite/*: Add dg-timeout-factor to most pstl and regex tests.
> 


[-- Attachment #2: 0001-changelog-allow-subdir-wildcard-entry.patch --]
[-- Type: text/x-patch, Size: 4026 bytes --]

From 1e5c644fb62e3e1757cf74fe8a14873d5e8ba53e Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Mon, 30 Nov 2020 13:41:26 +0100
Subject: [PATCH] changelog: allow subdir wildcard entry

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Allow sub-directory wildcard
	changelog entry. Fix a typo caused by apostrophe escaping.
	* gcc-changelog/test_email.py: Test it.
	* gcc-changelog/test_patches.txt: Likewise.
---
 contrib/gcc-changelog/git_commit.py    |  4 ++--
 contrib/gcc-changelog/test_email.py    |  9 ++++++++-
 contrib/gcc-changelog/test_patches.txt | 24 ++++++++++++++++++++++++
 3 files changed, 34 insertions(+), 3 deletions(-)

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index 6487de3271d..57fba756d32 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -493,7 +493,7 @@ class GitCommit:
         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:
+                if not [name.startswith(pr) for pr in wildcard_prefixes]:
                     msg = 'unsupported wildcard prefix'
                     self.errors.append(Error(msg, name))
 
@@ -617,7 +617,7 @@ class GitCommit:
 
         for pattern in mentioned_patterns:
             if pattern not in used_patterns:
-                error = 'pattern doesn''t match any changed files'
+                error = "pattern doesn't match any changed files"
                 self.errors.append(Error(error, pattern))
 
     def check_for_correct_changelog(self):
diff --git a/contrib/gcc-changelog/test_email.py b/contrib/gcc-changelog/test_email.py
index 579194cdc24..48ecc1ee6a6 100755
--- a/contrib/gcc-changelog/test_email.py
+++ b/contrib/gcc-changelog/test_email.py
@@ -333,7 +333,7 @@ class TestGccChangelog(unittest.TestCase):
         assert not email.errors
         email = self.from_patch_glob('0002-libstdc-Fake-test-change-1.patch')
         assert len(email.errors) == 1
-        msg = 'pattern doesn''t match any changed files'
+        msg = "pattern doesn't match any changed files"
         assert email.errors[0].message == msg
         assert email.errors[0].line == 'libstdc++-v3/doc/html/'
         email = self.from_patch_glob('0003-libstdc-Fake-test-change-2.patch')
@@ -386,3 +386,10 @@ class TestGccChangelog(unittest.TestCase):
         email = self.from_patch_glob('0001-lto-fix-LTO-debug')
         assert not email.errors
         assert len(email.changelog_entries) == 1
+
+    def test_wildcard_in_subdir(self):
+        email = self.from_patch_glob('0001-Wildcard-subdirs.patch')
+        assert len(email.changelog_entries) == 1
+        err = email.errors[0]
+        assert err.message == "pattern doesn't match any changed files"
+        assert err.line == 'libstdc++-v3/testsuite/28_regex_not-existing/'
diff --git a/contrib/gcc-changelog/test_patches.txt b/contrib/gcc-changelog/test_patches.txt
index 9e9c5cd893f..02ce28d20b8 100644
--- a/contrib/gcc-changelog/test_patches.txt
+++ b/contrib/gcc-changelog/test_patches.txt
@@ -3320,3 +3320,27 @@ index 7c9d492f6a4..37e73348cb7 100644
 -- 
 2.25.1
 
+=== 0001-Wildcard-subdirs.patch ===
+From b798205595426c53eb362065f6ed6c320dcc161d Mon Sep 17 00:00:00 2001
+From: Martin Liska <mliska@suse.cz>
+Date: Mon, 30 Nov 2020 13:27:51 +0100
+Subject: [PATCH] Fix it.
+
+libstdc++-v3/ChangeLog:
+
+	* testsuite/28_regex/*: Fix them all.
+	* testsuite/28_regex_not-existing/*: Fix them all.
+---
+ contrib/gcc-changelog/git_commit.py          | 1 +
+ libstdc++-v3/testsuite/28_regex/init-list.cc | 1 +
+ 2 files changed, 2 insertions(+)
+
+diff --git a/libstdc++-v3/testsuite/28_regex/init-list.cc b/libstdc++-v3/testsuite/28_regex/init-list.cc
+index f51453f019a..d10ecf483f4 100644
+--- a/libstdc++-v3/testsuite/28_regex/init-list.cc
++++ b/libstdc++-v3/testsuite/28_regex/init-list.cc
+@@ -1 +1,2 @@
+ 
++
+--
+2.29.2
-- 
2.29.2


  reply	other threads:[~2020-11-30 12:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 16:23 Jonathan Wakely
2020-11-30  9:43 ` Martin Liška
2020-11-30 11:58   ` Jonathan Wakely
2020-11-30 12:14     ` Martin Liška
2020-11-30 12:23       ` Jonathan Wakely
2020-11-30 12:43         ` Martin Liška [this message]
2020-11-30 12:48           ` Jonathan Wakely

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=aa18ed1c-1cac-e707-8869-f6b66266c341@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /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).