From: Stephan Beyer <s-beyer@gmx.net>
To: martin f krafft <madduck@madduck.net>
Cc: git discussion list <git@vger.kernel.org>
Subject: Re: Git commit hash clash prevention
Date: Thu, 2 Oct 2008 18:04:28 +0200 [thread overview]
Message-ID: <20081002160427.GD7288@leksak.fem-net> (raw)
In-Reply-To: <20081002085358.GA5342@lapse.rw.madduck.net>
[-- Attachment #1: Type: text/plain, Size: 1271 bytes --]
Hi,
martin f krafft wrote:
> Hi folks,
>
> 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.
Changing the committer time is the easiest way to solve this problem,
if it ever happens.
I have wondered how Git would behave if there are two files that are
not equal but have the same SHA-1. But I haven't found any such example
files to test this scenario and have not had the time to write or
look for a tool that generates them. (MD5 collisions can be generated
within 2 hours on usual home hardware and even Wikipedia links to
collided files. An intelligent search for SHA-1 collisions takes
2^63 evaluations and not 2^80 (simple birthday attack) as expected.
So it should be possible to find some random collisions and test the
behavior...)
But even if git behaves terrible useless in such situations, it
does not make any sense to guard against them, because in practice
they just do not happen. (And I think such guards will just slow git
down in the usual case.)
Regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]
prev parent reply other threads:[~2008-10-02 16:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-02 8:53 Git commit hash clash prevention martin f krafft
2008-10-02 9:18 ` Thomas Rast
2008-10-02 11:08 ` Jean-Luc Herren
2008-10-02 10:07 ` Johannes Schindelin
2008-10-02 14:00 ` Jakub Narebski
2008-10-02 15:39 ` Johannes Schindelin
2008-10-02 16:04 ` Stephan Beyer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081002160427.GD7288@leksak.fem-net \
--to=s-beyer@gmx.net \
--cc=git@vger.kernel.org \
--cc=madduck@madduck.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).