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

Re: [PATCH v1] hash: handle invalid algorithms when formatting object IDs

From
TJTanga Joris <tangajoris@gmail.com>
Date
Nov 7, 2026, 20:22 UTC
Message-ID
<CAKrRMNqBCiH06xsre-YafBJiqPTiBgPnNZ3xPrhjTQWU3czwHg@mail.gmail.com>
In-Reply-To
<au0ZOsuyo0YYyZsa@fruit.crustytoothpaste.net>
Hi brian,
Thank you for jumping in.

On Fri, 6 Nov 2026 at 03:03, brian m. carlson <sandals@crustytoothpaste.net> wrote:

> Minor nit: I use they/them pronouns.
I'm really sorry for getting your pronouns wrong.
Show 11 quoted lines
> This is not a valid configuration.  I have a patch on my sha256-interop
> branch, 5b208e4a3d34ffba0fbeafe991643d6d47a5caa0, that should make the
> members not public.  It depends partially on things other in that
> series, but it should be fine to drop those pieces if you want to pick
> that up and send it in.
>
> If you pass the structure from C, it's intended that it panics if algo
> is zero.  That's because we don't want to rely on the behaviour of
> depending on a mutable global in Rust, since that's unsafe and leads to
> action at a distance.  We really should just drop that fallback and fix
> all of the relevant callers at some point.

That makes sense. I didn't know algo 0 coming from C is meant to panic in Rust, rather than depend on the default hash.

Since this is shrimech's thread, I think shrimech could pick up 5b208e4a3d (making the ObjectID members private), and I'd be happy to review it.

Could you also push 5b208e4a3d somewhere public? I could not fetch it from https://github.com/bk2204/git, whose sha256-interop branch seems to have an older version (c38d0c8475, "rust: don't expose the internals of ObjectID"). That would make it easier for shrimech to pick up.

Thanks, Tanga

Previous: brian m. carlsonNext: brian m. carlson
Message 4 of 5 in “hash: handle invalid algorithms when formatting object IDs”
  1. hash: handle invalid algorithms when formatting object IDsshrimech, Nov 3, 2026
  2. Tanga JorisNov 5, 2026
  3. brian m. carlsonNov 6, 2026
  4. Tanga JorisNov 7, 2026
  5. brian m. carlsonNov 9, 2026

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.