[Linux-kernel-mentees] [PATCH v2] checkpatch: handle line break between commit and hash value

Ayush ayush at disroot.org
Sun Sep 13 12:06:43 UTC 2020


> Did checkpatch.pl output on other types change?
> 
> One of the testers on this list reported that two COMMIT_LOG_LONG_LINE
> reports disappeared. That should not have happened, right?
> 
> I had a look at the checkpatch.pl output for commit 0a2bd55c194a ("dm
> integrity: document allow_discard option").
> 
> I think the reported line is wrong here.

After the patch, It reports the following line:

#6: 
Add decription of the allow_discard option added in commit

Which I think is right as the author wanted to refer commit, which started from the word "commit"
in the reported line only.

Please give your opinion on this. 


> Also, the line number for other cases have changed.


Actually I am noticing a weird thing. When I run checkpacth.pl on multiple commits using v5.7..v5.8,
It is not showing correct output, like for some commits, I can see the command when run on multiple commits
did not report an error but when I ran on that individual commit, it's reporting an error.


- Running scripts/checkpatch.pl --show-types -g v5.7..v5.8, gives (for this particular commit):

-----------------------------------------------------------------------------------------------
Commit 3dbf1ee6abbb ("pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler")
-----------------------------------------------------------------------------------------------
total: 0 errors, 0 warnings, 15 lines checked

Commit 3dbf1ee6abbb ("pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler") has no obvious style problems and is ready for submission.



- Running scripts/checkpatch.pl --show-types -g 3dbf1ee6abbb, gives:


ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit cdca06e4e859 ("pinctrl: baytrail: Add missing spinlock usage in byt_gpio_irq_handler")'
#11: 
cdca06e4e859 ("pinctrl: baytrail: Add missing spinlock usage in

total: 1 errors, 0 warnings, 15 lines checked

NOTE: For some of the reported defects, checkpatch may be able to
      mechanically convert to the typical style using --fix or --fix-inplace.

Commit 3dbf1ee6abbb ("pinctrl: cherryview: Add missing spinlock usage in chv_gpio_irq_handler") has style problems, please review.



This is the reason the analysis on a large no. of commits was incorrect.

I need to investigate this more and check if it's an issue on my side or on the checkpatch.pl side.

Also, I noticed one more issue with my patch, it doesn't handle cases like:

- commit
1234567890ab ("foo
bar")


Due to this, some new GIT_COMMIT_ID errors were also reported.

So, I will try to address this in the next version.

Thanks,
Ayush


More information about the Linux-kernel-mentees mailing list