Subject: Re: [PATCH v4] read-cache: use istate->repo for trace2 logging

From: Derrick Stolee <[email-masked]>
Date: Thu, 2 Apr 2026 10:26:14 -0400

On 3/30/26 4:04 PM, Junio C Hamano wrote:
> "Jayesh Daga via GitGitGadget" <[email-masked]> writes:
> 
>> From: Jayesh Daga <[email-masked]>
>>
>> trace2 calls in read-cache.c use the global 'the_repository',
>> even though the relevant index_state provides an explicit
>> repository pointer via 'istate->repo'.
>>
>> Using the global repository can result in incorrect trace2
>> output when multiple repository instances are in use, as
>> events may be attributed to the wrong repository.
>>
>> Use 'istate->repo' instead to ensure correct repository
>> attribution.
>>
>> Signed-off-by: Jayesh Daga <[email-masked]>
>> ---
>> Range-diff vs v3:
>>
>>   1:  5a8165b05d < -:  ---------- repo: add paths.git_dir repo info key
>>   2:  9bb6d0fa01 = 1:  c99d731efa read-cache: use istate->repo for trace2 logging
> 
> A range-diff with v2 would have been much more relevant, but the
> patch below looks super boring compared to v2 which is very good.
> Just replacing the_repository with istate->repo and nothing else,
> which is exactly we expect to see from the patch title above ;-)
> 
> Will queue.  Thanks.

Thanks for putting in the work to create this complete
commit. LGTM.

-Stolee