#562 Make sure all commits have a proper subject
Merged by onosek. Opened by sgallagh.
sgallagh/rpkg subject  into  master

Download 562.patch

Until the first empty line, Git will always consider all of the commit
message to be part of the subject line. When generating the clog from
the RPM changelog, this means that all lines in the changelog end up as
part of the subject.

This patch reworks the clog() function to always have a distinct subject
line, either by accepting the -m argument or by treating the first
line of the changelog as special and inserting an extra newline for it.

Signed-off-by: Stephen Gallagher sgallagh@redhat.com

Note that without this fix, we have problems in CentOS Stream 9, since the way git reflows the subject line sometimes causes it to have a line break between the Resolves: and bug ID portions, resulting in the commit being rejected by the gitbz_check gate.

rebased onto 9ac1a65567c4bd65d9fb80faebbb7385353ee079

Hi @sgallagh,

I check the code and tried the functionality. The implementation idea looks good. Commit messages that were generated didn't contain empty lines in any case I tested. And the message specified with "-m" argument was joined with the rest of the clog message:

$ rpmdev-bumpspec fedpkg.spec
$ fedpkg commit --with-changelog -m bbb

has produced the commit message:
bbbrebuilt

That's strange... it was working for me. I'll investigate and get back to you.

rebased onto 2039d1dc68a050d488b57e62616132e74e73e827

Okay, it looks like I misunderstood how file.writelines() works. Hopefully this version will be correct.

Yes, this was fixed.
Do you think, that the subject behaviour should be disabled with the current parameter --raw? If somebody wants raw input as the help says:
'Generate a more "raw" clog without twiddling the contents'.
I am not decided yet.

Yes, this was fixed.
Do you think, that the subject behaviour should be disabled with the current parameter --raw? If somebody wants raw input as the help says:
'Generate a more "raw" clog without twiddling the contents'.
I am not decided yet.

Yes, this was fixed.
Do you think, that the subject behaviour should be disabled with the current parameter --raw? If somebody wants raw input as the help says:
'Generate a more "raw" clog without twiddling the contents'.
I am not decided yet.

I would prefer not to allow this; the existence of extremely long subject lines is causing real-world problems that can be easily avoided by just moving that content into the body of the message.

rebased onto 062fcc17bc5dd92d86c4b7e9b588f2e88accf751

I just rebased this to the latest upstream version. Could we get this landed soon?

Commit 778340c6 fixes this pull-request

Pull-Request has been merged by onosek

I merged your request. I simply modified unittests to pass. Failures weren't shown because there is something wrong with the CentOS Jenkins instance.

Metadata