git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: vinassa vinassa <vinassa.vinassa@gmail.com>
To: git@vger.kernel.org
Subject: git behaviour question regarding SHA-1 and commits
Date: Sun, 13 Nov 2011 18:04:17 +0100	[thread overview]
Message-ID: <CAJuRt+r9BjYcead6hgzdUT0Bisz1D48cegqkoJ0S537VMYBy_g@mail.gmail.com> (raw)

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

             reply	other threads:[~2011-11-13 17:04 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-13 17:04 vinassa vinassa [this message]
2011-11-13 17:41 ` git behaviour question regarding SHA-1 and commits Æ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

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJuRt+r9BjYcead6hgzdUT0Bisz1D48cegqkoJ0S537VMYBy_g@mail.gmail.com \
    --to=vinassa.vinassa@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).