git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Implement fast hash-collision detection

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 30, 2011, 18:05 UTC
Message-ID
<7vzkfdqye3.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CACsJy8A6kGmn0h0xdxfTC4krXgc8hzO1fHTdqfk0YnASGN5K0w@mail.gmail.com>
Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes:
> What I'm thinking is whether it's possible to decouple two sha-1 roles
> in git, as object identifier and digest, separately.

Why it would be a good thing? If you have a collided identifier, somebody has to choose which blob a particular tree wants to have at the path, and because the tree would not record anything but the identifier, you cannot.

Show 5 quoted lines
> ...
> The day sha-1 is broken, a project can generate new digests from its
> old good repo and enforce developers to use new digests for
> verification instead of sha-1. sha-1 is still used by git as
> identifier after that day.

And an old blob that is identified with a SHA-1 now has a new blob that has different contents but happens to have the same SHA-1. How does Git decide which blob to use when a particular object is named by the SHA-1?

Previous: Nguyen Thai Ngoc DuyNext: Nguyen Thai Ngoc Duy
Message 9 of 20 in “Re: [PATCH] Implement fast hash-collision detection”
  1. Jeff KingNov 29, 2011
  2. Ævar Arnfjörð BjarmasonNov 29, 2011
  3. Jeff KingNov 29, 2011
  4. Nguyen Thai Ngoc DuyNov 29, 2011
  5. Shawn PearceNov 29, 2011
  6. Nguyen Thai Ngoc DuyNov 29, 2011
  7. Jeff KingNov 29, 2011
  8. Nguyen Thai Ngoc DuyNov 30, 2011
  9. Junio C HamanoNov 30, 2011
  10. Nguyen Thai Ngoc DuyDec 1, 2011
  11. Bill ZaumenNov 30, 2011
  12. Bill ZaumenNov 29, 2011
  13. Jeff KingNov 30, 2011
  14. Bill ZaumenDec 1, 2011
  15. Jeff KingDec 1, 2011
  16. Bill ZaumenDec 2, 2011
  17. Jeff KingDec 2, 2011
  18. Shawn PearceNov 29, 2011
  19. Jeff KingNov 29, 2011
  20. Bill ZaumenNov 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.