git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git behaviour question regarding SHA-1 and commits
@ 2011-11-13 17:04 vinassa vinassa
  2011-11-13 17:41 ` Ævar Arnfjörð Bjarmason
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: vinassa vinassa @ 2011-11-13 17:04 UTC (permalink / raw)
  To: git

Hello,

I am relatively new to git; I have only used it to track other git
projects, and sometimes to format and send patches to them, but never
to handle my own projects.

Now I am considering using git for my next task at work.

I am wondering about how git behaves currently, if I kinda win the
lottery of the universe, and happen to create a commit with a SHA-1
that is already the SHA-1 of another commit in the previous history.
However improbable.

Would that be detected, so that I could just add a newline, and then
commit with a different resulting SHA-1,
would I just lose one of those commits (hopefully the new one), would
I end up with a corrupted repository?

I found some mention of this in the archive, more about SHA-1 security
implications, that were dismissed, but here I am looking at just a
random, very unfortunate case, and just wondering if in this case I
would end up in a FUBAR situation.

Thank you,

Vinassa

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-11-14 13:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-13 17:04 git behaviour question regarding SHA-1 and commits vinassa vinassa
2011-11-13 17:41 ` Ævar Arnfjörð Bjarmason
2011-11-14  3:29   ` Junio C Hamano
2011-11-14 11:48     ` Jeff King
2011-11-13 18:27 ` Jonathan Nieder
2011-11-13 22:14   ` vinassa vinassa
2011-11-14 11:32   ` Jeff King
2011-11-14 12:48     ` Victor Engmark
2011-11-14 13:04       ` Jeff King
2011-11-13 22:14 ` Dmitry Potapov
2011-11-14  7:39 ` Johannes Sixt

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).