Subject: Re: [PATCH] object-file: avoid ODB transaction when not writing objects

From: Justin Tobler <[email-masked]>
Date: Tue, 7 Apr 2026 17:41:12 -0500

On 26/04/07 03:24PM, Junio C Hamano wrote:
> Justin Tobler <[email-masked]> writes:
> 
> > On 26/04/07 02:53PM, Junio C Hamano wrote:
> >> Junio C Hamano <[email-masked]> writes:
> >> 
> >> > I'd appreciate it if you can give your eyeballs to the attached to
> >> > see if that is how you would fixed the bug in the original context
> >> > of v2.52 track.  If everything looks OK, then there is no need to
> >> > spend time backporting on your side.  We have everything necessary.
> >> 
> >> Another thing.  Your jt/odb-transaction-write topic (in 'seen')
> >> already addresses this issue, so we may merge this single patch down
> >> to 'next' and 'master' first, but the merge that brings in the topic
> >> can just supersede this patch, perhaps keeping the test added to
> >> t1517.
> >
> > That would work :)
> >
> >> Do I understand correctly?  The t1517 part of the patch, when
> >> applied to 'seen', does indicate that the problem is not there.
> >
> > Yes, that is correct. The jt/odb-transaction-write topic indeed already
> > fixes this issue. The patch here is just a slimmed down version of a
> > patch from that series.
> >
> > I can also send a follow up version for the topic built on top of this
> > patch if that would be preferred. Otherwise, replacing the patch with
> > the original topic and keeping the test as you suggested would work just
> > fine.
> 
> OK.  I think I am almost done preparing for tonight's pushout, so
> please double check, and complain if you see something that is
> questionable, when it happens.  It probably will happen in 2 hours
> or so.

Thanks, I'll make sure to double check.

I'm not sure if you already included an update for the test per Peff's
comments, but if not we can do something like below. If you would like I
can send another version with it included too.

Thanks,
-Justin

--- >8 ---
diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh
index c1dbc6359a..e1d35170de 100755
--- a/t/t1517-outside-repo.sh
+++ b/t/t1517-outside-repo.sh
@@ -93,12 +93,12 @@ test_expect_success 'diff outside repository' '
 	test_cmp expect actual
 '
 
-test_expect_success 'diff files exceeding bigFileThreshold outside repository' '
-	cd non-repo &&
-	echo foo >foo &&
-	echo bar >bar &&
-	test_must_fail git -c core.bigFileThreshold=1 diff -- foo bar >actual &&
-	test_grep "diff --git a/foo b/bar" actual
+test_expect_success 'hash object exceeding bigFileThreshold outside repository' '
+	(
+		cd non-repo &&
+		echo foo >foo &&
+		git -c core.bigFileThreshold=1 hash-object --stdin <foo
+	)
 '
 
 test_expect_success 'stripspace outside repository' '