Re: [PATCH 2/3] checkpatch: enforce 12-char SHA for Fixes tags

From: Greg Kroah-Hartman
Date: Tue Jul 22 2025 - 04:00:50 EST


On Mon, Jul 21, 2025 at 12:24:33PM -0400, Ignacio Peña wrote:
> The kernel documentation recommends using 12 character SHA-1 hashes
> in Fixes tags as the best practice. While 8 characters might be
> sufficient for uniqueness in smaller projects, the kernel's large
> history makes collisions more likely with shorter hashes.
>
> Change the existing check from "at least 8" to "exactly 12" to
> encourage consistency and future-proof practices.

That's not what this patch does. You are changing it from "12+" to
"exactly 12". There's no 8 character check here that I can see.


>
> Link: https://docs.kernel.org/process/submitting-patches.html#describe-your-changes
> Suggested-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
> Signed-off-by: Ignacio Pena <ignacio.pena87@xxxxxxxxx>
> ---
> scripts/checkpatch.pl | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 7ccdc774a..204800232 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3242,7 +3242,7 @@ sub process {
> my $tag_case = not ($tag eq "Fixes:");
> my $tag_space = not ($line =~ /^fixes:? [0-9a-f]{5,40} ($balanced_parens)/i);
>
> - my $id_length = not ($orig_commit =~ /^[0-9a-f]{12,40}$/i);

That is checking for 12-40 long, right? Not 8 :)

thanks,

greg k-h