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

Re: [PATCH] object-file: don't use object database without a repository

From
Justin Tobler <jltobler@gmail.com>
Date
Apr 6, 2026, 18:17 UTC
Message-ID
<adP0hnV7Gl08qqqf@denethor>
In-Reply-To
<20260405191750.GA1525850@coredump.intra.peff.net>
On 26/04/05 03:17PM, Jeff King wrote:
> But I think the actual code change in your patch is the wrong thing, so
> I also don't think we'd want to just squash that test in. I'm hoping
> Justin has some insights on how to do a more complete fix.

I agree with Peff here that the correct fix should continue to use the object streaming mechanisms. To avoid this segfault, we really should avoid using ODB transactions when there isn't an ODB in the first place.

I replied in another thread[1] with how we could go about fixing. To summarize, it just so happens that I already have a patch[2] out on the list that appears to resolve this issue.

For the use case here, git-diff(1) is only interested in generating the hash for the "large" blobs and not actually writing anything to the ODB. This patch introduces a separate "hash-only" variant of `index_blob_packfile_transaction()` and is used to bypass creating an ODB transaction when object writes are not needed.

If this is the route we want to go down, I can extract this patch from the current series and send it as a separate fix. :)

-Justin

[1]: https://lore.kernel.org/git/adPjXKGIT5O7SK6E@denethor/T/#m9cee420941b66abfb0244ea4b7762ba8d0ff7b52 [2]: https://lore.kernel.org/git/20260402213220.2651523-5-jltobler@gmail.com/

Previous: Jeff KingNext: Luca Stefani
Message 6 of 10 in “object-file: don't use object database without a repository”
  1. object-file: don't use object database without a repositoryLuca Stefani, Apr 4, 2026
  2. Pushkar SinghApr 5, 2026
  3. Jeff KingApr 5, 2026
  4. Luca StefaniApr 5, 2026
  5. Jeff KingApr 5, 2026
  6. Justin ToblerApr 6, 2026
  7. Luca StefaniApr 6, 2026
  8. Justin ToblerApr 6, 2026
  9. Jeff KingApr 6, 2026
  10. Justin ToblerApr 6, 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.