Re: Git commit hash clash prevention

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Thomas Rast
Date: Thursday, October 2, 2008 - 2:18 am

martin f krafft wrote:

There are two cases:

* The commits are exactly identical.  This won't happen in your
  scenario, but is still theoretically possible if you commit the same
  tree with the same author info, timestamps, etc. on two different
  machines.  Then there is no problem, because they really are the
  same.

* They're not identical, but there is a hash collision.  Git will
  become very confused because it only ever saves one of them.  (I
  suppose it'd "only" corrupt the DAG if the two are commits, but in
  the general case a commit could collide with a tree etc.)

  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.

(I hope I did the counting right...)


No, it does not distinguish between objects in any way but the SHA1.

=2D Thomas

=2D-=20
Thomas Rast
trast@student.ethz.ch
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Git commit hash clash prevention, martin f krafft, (Thu Oct 2, 1:53 am)
Re: Git commit hash clash prevention, Thomas Rast, (Thu Oct 2, 2:18 am)
Re: Git commit hash clash prevention, Johannes Schindelin, (Thu Oct 2, 3:07 am)
Re: Git commit hash clash prevention, Jean-Luc Herren, (Thu Oct 2, 4:08 am)
Re: Git commit hash clash prevention, Jakub Narebski, (Thu Oct 2, 7:00 am)
Re: Git commit hash clash prevention, Johannes Schindelin, (Thu Oct 2, 8:39 am)
Re: Git commit hash clash prevention, Stephan Beyer, (Thu Oct 2, 9:04 am)