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

Question: how will sha256sum be implemented in git

From
Aditya Garg <gargaditya08@live.com>
Date
Jul 4, 2025, 11:18 UTC
Message-ID
<PN3PR01MB9597524FAEAA3B26B15804B9B842A@PN3PR01MB9597.INDPRD01.PROD.OUTLOOK.COM>
Hi all

I just read that git aims to transition to SHA256 by default, and conversion from SHA1 to SHA256 is needed for old repos. I was just curious how will that be achieved.

Dumb idea, but maybe we can just encode the existing SHA1 sums' string to SHA256?
Eg: 

$ echo -n 8994f255af5451b6cd1db01ee16d8cf15b9df81e | sha256sum bf8d6d915848377db81ee47e883c0a683b3d86a49ab120191ea1c3d76a30c33f *-

so bf8d6d915848377db81ee47e883c0a683b3d86a49ab120191ea1c3d76a30c33f will be our new commit hash.
I think we can do that since sha256sum is chosen due to negligible collisions right?
Next: brian m. carlson
Message 1 of 3 in “Question: how will sha256sum be implemented in git”
  1. Aditya GargJul 4, 2025
  2. brian m. carlsonJul 4, 2025
  3. Aditya GargJul 5, 2025

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.