gcc-changelog: detect Co-Authored-By before ChangeLog entries

Message ID c783ea9a-7221-d7cc-73b5-57416f3dcb41@suse.cz
State New
Headers show
Series
  • gcc-changelog: detect Co-Authored-By before ChangeLog entries
Related show

Commit Message

Martin Liška May 14, 2021, 8:45 a.m.
Pushed to master. It handles e.g. commit f1a68574b1f8d2961d3a676dbcf0cc24b6368578:

     libstdc++: Define __cpp_lib_to_chars for C++20 [PR 100146]

     

     This defines the feature test macro when uselocale is available, because

     the floating-point std::from_chars support currently depends on that.

     

     Co-authored-by: Jakub Jelinek <jakub@redhat.com>

     

     libstdc++-v3/ChangeLog:

     

             PR libstdc++/100146

             * include/std/charconv (__cpp_lib_to_chars): Define

...

Martin

contrib/ChangeLog:

	* gcc-changelog/git_commit.py: Support Co-Authored-By before
	a first ChangeLog entry.
---
  contrib/gcc-changelog/git_commit.py | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.31.1

Patch

diff --git a/contrib/gcc-changelog/git_commit.py b/contrib/gcc-changelog/git_commit.py
index 8f9b266fde9..4958ab9c159 100755
--- a/contrib/gcc-changelog/git_commit.py
+++ b/contrib/gcc-changelog/git_commit.py
@@ -409,7 +409,8 @@  class GitCommit:
                  continue
              if (changelog_regex.match(b) or self.find_changelog_location(b)
                      or star_prefix_regex.match(b) or pr_regex.match(b)
-                    or dr_regex.match(b) or author_line_regex.match(b)):
+                    or dr_regex.match(b) or author_line_regex.match(b)
+                    or b.lower().startswith(CO_AUTHORED_BY_PREFIX)):
                  self.changes = body[i:]
                  return
          if not all_are_ignored: