[Linux-kernel-mentees] Regarding "Linux Kernel: Evaluate and Improve checkpatch.pl"

Lukas Bulwahn lukas.bulwahn at gmail.com
Mon Sep 7 16:43:19 UTC 2020

On Mon, Sep 7, 2020 at 4:28 PM Ayush <ayush at disroot.org> wrote:
> September 7, 2020 1:09 PM, "Lukas Bulwahn" <lukas.bulwahn at gmail.com> wrote:
> > I think you should extend this whole check to work properly with line
> > breaks. You can see how this is implemented currently in checkpatch.pl
> > just a few lines above, right?
> I have written the conditions for handling line breaks.
> I will be sending the patch to the mailing list after this mail.
> > Can you provide a full list of checkpatch.pl findings in v5.4..v5.8
> > where all the different commit 1234567890ab ("Revert "..."") variants
> > in the commit message appear?
> >
> > Then, we can use those commits directly as test cases for your extension?
> Actually, I have made a list for some of the similar commits which are correct but
> checkpatch.pl will give GIT_COMMIT_ID error on them. I have tested my patch with 30+ commits.
> Here is the list of commits:
> https://gist.githubusercontent.com/eldraco19/f78e637ead0e47e1bb187f83a391a904/raw/1ee853ab1b7db86d663f6537b7c43e284e30dad2/commits.txt
> Some doubts I still have:
> - commit
> 1234567890ab ("Revert "foo bar"")
> is not allowed as per the rules, right?

No, that is allowed. There can be of course a line break after commit
and before the hash, it is just that the current checkpatch.pl script
does not handle this case yet.

That would need improvement.

> - if the commit mentioned has double-quotes like:
> commit 1234567890ab ("Revert "foo "lorem ipsum" bar"")
> example: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-5.8.y&id=9d7c249a1ef9bf0d5696df14e6bc067004f16979
> For now, checkpatch.pl is giving an error in such cases too. But there can be `n` cases like these, we
> can have so many quotes nested, so I think it's better to avoid this pattern, please give your opinions on this.

I do not think that it is disallowed, but maybe a new check in
checkpatch.pl is recommended to make aware that quotes in commit
message subject lines cannot be properly handled and are discouraged.


More information about the Linux-kernel-mentees mailing list