git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] checkpatch: Add test for commit id formatting style in commit log

From
Geert Uytterhoeven <geert@linux-m68k.org>
Date
Aug 10, 2014, 21:08 UTC
Message-ID
<CAMuHMdV1TXLmuAofwrUuT-KKUfkEYdXsM34VRrfhB6FxXfdeeg@mail.gmail.com>
In-Reply-To
<1404338448.14741.8.camel@joe-AO725>
Hi Joe,
On Thu, Jul 3, 2014 at 12:00 AM, Joe Perches <joe@perches.com> wrote:
Show 7 quoted lines
> Commit logs have various forms of commit id references.
>
> Try to standardize on a 12 character long lower case
> commit id along with a description of parentheses and
> the quoted subject line
>
> ie: commit 0123456789ab ("commit description")

Now this is in mainline, checkpatch starts complaining about my "too long" (40 chars) commit IDs in commit messages :-(

40 chars may be too long (but it's quick to copy-and-paste, as "git show" shows that by default), but 12 sounds a bit short, as that's only 48 bits.

According to the Birthday Paradox (en.wikipedia.org/wiki/Birthday_problem), there's a probability of 50% of a collision if you use 48 bits IDs in a repository with ca. 16 milion (2^24) objects. A Linux kernel repository counts ca. 4 million objects, so we're getting close...

So soon we'll get "error: short SHA1 is ambiguous".

BTW, is there actually an easy way to make "git show" show all options for an ambiguous SHA1?

Gr{oetje,eeting}s,
                        Geert

-- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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
Next: Joe Perches
Message 1 of 4 in “Re: [PATCH] checkpatch: Add test for commit id formatting style in commit log”
  1. Geert UytterhoevenAug 10, 2014
  2. Joe PerchesAug 10, 2014
  3. Andrew MortonAug 10, 2014
  4. Joe PerchesAug 10, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.