Skip to contentSkip to conversation

scripts, checkpatch.pl, provide a better output message for commit id format errors

PATCH In review Prarit Bhargava 2 participants 2 messages Oct 17, 2014 Checkpatch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts, checkpatch.pl, provide a better output message for commit id format errors

I put together a patch with an incorrect format and the following error was returned by checkpatch.pl:

ERROR: Please use 12 or more chars for the git commit ID like: 'Commit 09ec54429c6d ("clocksource: Move cycle_last validation to core code")' Commit 09ec54429c6d10f87d1f084de53ae2c1c3a81108, clocksource: Move

The message is confusing. Change it to request that the author use the example commit ID format.

Cc Andy Whitcroft <[email protected]>
Cc Joe Perches <[email protected]>
---
 scripts/checkpatch.pl |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 374abf4..68312fa 100755
@@ -2174,7 +2174,7 @@ sub process {
 			my $desc = 'commit description';
 		        ($id, $desc) = git_commit_info($orig_commit, $id, $desc);
 			ERROR("GIT_COMMIT_ID",
-			      "Please use 12 or more chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr);
+			      "Please format the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr);
 		}
 
 # Check for added, moved or deleted files
Signature · 1 line
1.7.9.3
maintainer
#1 lore raw
Quoted 9 lines · Prarit Bhargava

I put together a patch with an incorrect format and the following error was returned by checkpatch.pl:

ERROR: Please use 12 or more chars for the git commit ID like: 'Commit 09ec54429c6d ("clocksource: Move cycle_last validation to core code")' Commit 09ec54429c6d10f87d1f084de53ae2c1c3a81108, clocksource: Move

The message is confusing. Change it to request that the author use the example commit ID format.

[]

scripts/checkpatch.pl

Quoted 1 line
scripts/checkpatch.pl +0 -0

[]

scripts/checkpatch.pl sub process { · line 2180

Quoted 9 lines
scripts/checkpatch.pl +1 -1
@@ -2174,7 +2174,7 @@ sub process {
 			my $desc = 'commit description';
 		        ($id, $desc) = git_commit_info($orig_commit, $id, $desc);
 			ERROR("GIT_COMMIT_ID",
-			      "Please use 12 or more chars for the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr);
+			      "Please format the git commit ID like: '${init_char}ommit $id (\"$desc\")'\n" . $herecurr);
 		}
 
 # Check for added, moved or deleted files

This doesn't show that a commit ID may be too short. Maybe there should be multiple error messages depending on what is not correct about the original.