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

Lukas Bulwahn lukas.bulwahn at gmail.com
Sat Sep 12 12:42:30 UTC 2020



On Sat, 12 Sep 2020, Ayush wrote:

> checkpatch.pl checks for proper references to other commits with
> the intended format, commit <12+ characters of SHA-1 ID> ("<commit
> message") and warns about typical mistakes. Currently, it does
> not handle the case where there is a line break between commit and the
> hash value.
> It falsely warns that the hash is not prefixed by the word commit.
> 
> This adds new conditions to parse and identify such commits and
> to not report an error in such cases.
> 
> following type of commit reference is handled:
> 
> - commit
> f4d51dffc6c01 ("Linux 5.9-rc4")
> 
> This issue was discovered through a thorough analysis of checkpatch.pl
> errors and warnings of type GIT_COMMIT_ID on commits between v5.7 and v5.8.
> 
> Before applying this patch, checkpatch.pl reported 342 errors of type
> GIT_COMMIT_ID. After applying patch, errors reduced to 284.
> 
> Signed-off-by: Ayush <ayush at disroot.org>

The patch does not apply on commit f4d51dffc6c0 ("Linux 5.9-rc4").

Applying: checkpatch: handle line break between commit and hash value
Checking patch scripts/checkpatch.pl...
error: while searching for:
my $git_command ='export LANGUAGE=en_US.UTF-8; git';
my $tabsize = 8;
my ${CONFIG_} = "CONFIG_";

sub help {
	my ($exitcode) = @_;


error: patch failed: scripts/checkpatch.pl:68
Hunk #2 succeeded at 2825 (offset -6 lines).
Hunk #3 succeeded at 2841 (offset -6 lines).
Hunk #4 succeeded at 2872 (offset -6 lines).
Applying patch scripts/checkpatch.pl with 1 reject...
Rejected hunk #1.
Hunk #2 applied cleanly.
Hunk #3 applied cleanly.
Hunk #4 applied cleanly.
Patch failed at 0001 checkpatch: handle line break between commit and hash value


What commit is your patch based on?

Try always to test that the commit applies on the current master and on 
the latest linux-next.

Lukas


More information about the Linux-kernel-mentees mailing list