Re: Git commit hash clash prevention

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, 2 Oct 2008, martin f krafft wrote:

> the other day during a workshop on Git, one of the attendants asked 
> about the scenario when two developers, Jane and David, both working on 
> the same project, both create a commit and the two just so happen to 
> have the same SHA-1. I realise that the likelihood of this happening is 
> about as high as the chance of <insert witty joke here>, but it *is* 
> possible, isn't it? Even though this is thus somewhat academic, I am 
> still very curious about it.

It _is_ academic.  Did you already discuss the chance that your wife gives 
birth to a mouse?  I haven't done the maths yet, but I am pretty certain 
that this would be more likely than an unintended SHA-1 collision.

> What happens when David now pulls from Jane? How does Git deal with 
> this?

Basically, the commit that David has will not be overwritten.  So every 
commit referring to Jane's commit would point to David's in his 
repository.

But the more likely case (well, as likely goes) would be that either 
Jane's or David's object is actually a blob.  And Git would complain about 
a type mismatch then.

Ciao,
Dscho
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux