From: Justin Tobler Date: Mon, 06 Apr 2026 20:31:57 GMT Subject: Re: [PATCH] object-file: don't use object database without a repository Message-ID: In-Reply-To: <568cb40a-373e-4ad1-a6a0-fb7289da92e2@gmail.com> On 26/04/06 09:31PM, Luca Stefani wrote: > > On 06/04/2026 20:17, Justin Tobler wrote: > > 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. > > Thanks, just verified it works as expected. Thanks for testing! :) > > > > 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. :) > If this ends up happening CC me and I'll gladly stamp it with Tested-by :) Will do! -Justin