On Thu, 10 Jun 2021 at 11:08, Jakub Jelinek <ja...@redhat.com> wrote: > > On Thu, Jun 10, 2021 at 11:01:49AM +0100, Jonathan Wakely via Gcc wrote: > > On 10/06/21 10:44 +0100, Jonathan Wakely wrote: > > > > Quite interesting idea! Are you willing to prepare a patch for it? > > > > > > This works. > > > > And this works better, because it checks the PR in the title matches > > one in the changelog. > > > > I'll get something added to the tests and prep this for commit. > > Note, some commits fix more than one PR. Sometimes the subject lists > just one of them and the ChangeLog several, at other times people mention > [PRnnnnnn, PRnnnnnn] etc. in the subject. > I think checking that at least one changeLog PR line matches at least one PR > in the subject would be good enough. > > Your regex will not match [PR123456, PR123457] in subject, perhaps ok
Yeah, that wouldn't get matched, so no checks would be done for the changelog body. Not ideal, but better than what we have no where nothing is checked at all. > initially, and if I read it will will be happy if at least one line matches > it. Yes, if the summary line has a single PR number, it must be present in the changelog body. Other PR numbers can also be in the body, and they aren't checked. But I've hit an issue trying to test it, because the testcases in contrib/gcc-changelog/test_patches.txt are in the form of emails, and the Subject: line from the emails is not passed to the GitInfo constructor, so isn't part of the message that gets checked. Martin, Shouldn't the GitEmail class extract the Subject: from the email header and use that as the first line passed to the GitInfo object?