git gcc-commit-mklog doesn't extract PR number to ChangeLog

Martin Sebor msebor@gmail.com
Thu Jun 10 14:55:59 GMT 2021


On 6/10/21 4:40 AM, Jonathan Wakely via Gcc wrote:
> On Thu, 10 Jun 2021 at 11:08, Jakub Jelinek <jakub@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?
> 

I'm a little lost as to what's being changed, and, truth be told,
what exactly the current "right" format is.  Where are the PRnnnnn
strings recognized as special?

The ChangeLog description doesn't seem to cover this and I've been
assuming they're recognized anywhere in the ChangeLog message, but
I think I also noticed they don't always end up updating all
the bugs.

FWIW, in commits for multiple PRs I've been adding a Resolves
line like this:
   https://gcc.gnu.org/pipermail/gcc-cvs/2021-May/347414.html

I usually also add the PR numbers under each ChangeLog but I'm not
sure it's necessary.  It would be good to know and for the ChangeLog
convention to document how exactly this works, and if something
changes, to update the documentation.

Martin


More information about the Gcc mailing list