Re: [PATCH] checkpatch: Also accept commit ids with 13-40 chars of sha1

From: Geert Uytterhoeven
Date: Wed Dec 06 2023 - 02:46:05 EST


Hi Joe,

On Tue, Dec 5, 2023 at 9:05 PM Joe Perches <joe@xxxxxxxxxxx> wrote:
> On Tue, 2023-12-05 at 20:34 +0100, Geert Uytterhoeven wrote:
> > Documentation/dev-tools/checkpatch.rst says:
> >
> > **GIT_COMMIT_ID**
> > The proper way to reference a commit id is:
> > commit <12+ chars of sha1> ("<title line>")
>
> It's not just checkpatch.
>
> Documentation/process/submitting-patches.rst:``git bisect``, please use the 'Fixes:' tag with the first 12 characters of
>
>
> So that would need to be updated as well.

And:

Documentation/process/maintainer-tip.rst: - Fixes: 12char-SHA1
("sub/sys: Original subject line")

but the example uses 15:

Documentation/process/maintainer-tip.rst: Fixes: abcdef012345678
("x86/xxx: Replace foo with bar")

Documentation/process/researcher-guidelines.rst: Fixes:
aaaabbbbccccdddd ("Introduce support for FooBar")

16

Documentation/process/submitting-patches.rst: Commit
e21d2170f36602ae2708 ("video: remove unnecessary

20

> And 12 still has quite some headroom.
>
> $ git rev-list --all --abbrev=0 --abbrev-commit | \
> awk '{ a[length] += 1 } END { for (len in a) print len, a[len] }'
> 5 107
> 6 684276
> 7 505734
> 8 41769
> 9 2665
> 10 174
> 11 8

How many collisions do you need? These will be dereferenced years
from now.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds