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

Re: Git commit hash clash prevention

From
JHJean-Luc Herren <jlh@gmx.ch>
Date
Oct 2, 2008, 11:08 UTC
Message-ID
<48E4ABC0.80100@gmx.ch>
In-Reply-To
<200810021118.15313.trast@student.ethz.ch>
Hello list!
Thomas Rast wrote:
Show 5 quoted lines
>   However, the expected number of objects needed to get a collision is
>   on the order of 2**80 (http://en.wikipedia.org/wiki/Birthday_attack),
>   and since there are (very roughly) 2**25 seconds in a year and 2**34
>   years in the age of the universe, that still leaves you with 2**21
>   ages of the universe to go.

In case it's interesting to someone, I once calculated (and wrote down) the math for the following scenario:

  - 10 billion humans are programming
  - They *each* produce 5000 git objects every day
  - They all push to the same huge repository
  - They keep this up for 50 years

With those highly exagerated assumptions, the probability of getting a hash collision in that huge git object database is 6e-13. Provided I got the math right.

So, mathematically speaking you have to say "yes, it *is* possible". But math aside it's perfectly correct to say "no, it won't happen, ever". (Speaking about the *accidental* case.)

jlh
Previous: Thomas RastNext: Johannes Schindelin
Message 3 of 7 in “Git commit hash clash prevention”
  1. martin f krafftOct 2, 2008
  2. Thomas RastOct 2, 2008
  3. Jean-Luc HerrenOct 2, 2008
  4. Johannes SchindelinOct 2, 2008
  5. Jakub NarebskiOct 2, 2008
  6. Johannes SchindelinOct 2, 2008
  7. Stephan BeyerOct 2, 2008

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.