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

Re: git: prepare to regularly change hashsums

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Aug 19, 2025, 21:18 UTC
Message-ID
<aKTqHTnOMp1LFNLD@fruit.crustytoothpaste.net>
In-Reply-To
<198c2b87f70.ff0fbb4065293.4919681043907358329@zohomail.com>
On 2025-08-19 at 14:25:27, Askar Safin wrote:
> Hi, git people. I just noticed that you plan to change default hashsum in git 3.0.
> Cool!
Thanks, I'm glad you're excited about it.  I am, too.
> Please, prepare for regular change of hashsum.
> No hash is forever. Be prepared to change hashsum algorithm once in 10 years.
> See here for details, i. e. why no hash is forever: https://valerieaurora.org/hash.html
Yes, this was a goal of the project when I did that work.

There are many fewer places where we have hard-coded hash values in the tests and a lot more places where we compute values (for instance, if what the test wants to know is that we're three commits before HEAD, then we write `HEAD~3` instead of a specific object ID). Instead of lots of hard-coded 20- and 40-based constants throughout the code, we have a few #define constants and a hash algorithm abstraction.

If we need to change the hash algorithm again, it will require substantially less work, and we'll have only 40 test files to change this time (which is a major improvement over last time).

I hope people also feel that the refactoring we did has made our codebase easier to understand and more maintainable.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Askar SafinNext: Simon Richter
Message 2 of 4 in “git: prepare to regularly change hashsums”
  1. Askar SafinAug 19, 2025
  2. brian m. carlsonAug 19, 2025
  3. Simon RichterAug 20, 2025
  4. brian m. carlsonAug 21, 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.