As well as the "contrig" typo that Florian noticed, the subject says
"in in" which should be "is in". And it should be CC'd to gcc-patches.

I like this more than my attempt, however ...

>--- a/contrib/gcc-changelog/git_repository.py
>+++ b/contrib/gcc-changelog/git_repository.py
>@@ -59,8 +59,9 @@ def parse_git_revisions(repo_path, revisions, ref_name=None):
>
>             date = datetime.utcfromtimestamp(c.committed_date)
>             author = '%s  <%s>' % (c.author.name, c.author.email)
>-            git_info = GitInfo(c.hexsha, date, author,
>-                               c.message.split('\n'), modified_files)
>+            message = c.message.split('\n')
>+            git_info = GitInfo(c.hexsha, date, author, message[0],
>+                               message[1:], modified_files)

Doesn't using message[1:] here mean that other checks which currently
look at all of self.info.lines will no longer check the subject line?

For example, we have:

        # Skip Update copyright years commits
        if self.info.lines and self.info.lines[0] == 'Update copyright years.':
            return

This will never match now, because you've extracted that into the
'subject' instead.

Would it be better to leave the first line in there, and just have it
duplicated in the new GitInfo.subject member? Or at least change the
check above to look at the subject, and review if other checks looking
at self.info.lines need to also check self.info.subject.


Aside: We should also have a check that the second line is blank, i.e.
the commit message is a single line subject, followed by blank,
followed by the body. And if we enforced that, then message[2:] would
be better than message[1:].

Reply via email to