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

Re: Starting to think about sha-256?

From
KHKrzysztof Halasa <khc@pm.waw.pl>
Date
Aug 28, 2006, 21:12 UTC
Message-ID
<m3r6z0ef95.fsf@defiant.localdomain>
In-Reply-To
<Pine.LNX.4.64.0608281317070.27779@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 9 quoted lines
> Anyway, the way to do it (if you want to use git to document SHA1 hash 
> mismatches) is to just check the files that have an identical SHA1 in. It 
> will magically work!
>
> Why? Because a git SHA1 is actually _not_ the SHA1 of the file itself, 
> it's the SHA1 of the file _with_the_git_header_added_.
>
> So if you find two files that have the same SHA1, they would also have to 
> have the same length in order to actually generate the same object name. 

Well, conflicting files will most probably have the same size, like with MD5 cases :-)

-- 
Krzysztof Halasa
Previous: Linus TorvaldsNext: Linus Torvalds
Message 15 of 19 in “Starting to think about sha-256?”
  1. Jeff GarzikAug 27, 2006
  2. Krzysztof HalasaAug 27, 2006
  3. Linus TorvaldsAug 27, 2006
  4. Krzysztof HalasaAug 27, 2006
  5. Johannes SchindelinAug 27, 2006
  6. Linus TorvaldsAug 27, 2006
  7. David LangAug 28, 2006
  8. Linus TorvaldsAug 28, 2006
  9. Linus TorvaldsAug 28, 2006
  10. Jeff KingAug 28, 2006
  11. Linus TorvaldsAug 28, 2006
  12. Jeff KingAug 28, 2006
  13. Krzysztof HalasaAug 28, 2006
  14. Linus TorvaldsAug 28, 2006
  15. Krzysztof HalasaAug 28, 2006
  16. Linus TorvaldsAug 28, 2006
  17. Johannes SchindelinAug 28, 2006
  18. Linus TorvaldsAug 28, 2006
  19. Florian WeimerAug 29, 2006

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.