git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 18:02 UTC

Re: [PATCH] read-cache: use index state repository for trace2 logging

From
jayesh0104 <jayeshdaga99@gmail.com>
Date
Mar 28, 2026, 05:25 UTC
Message-ID
<20260328052505.76445-1-jayeshdaga99@gmail.com>
In-Reply-To
<xmqqqzp5kzj3.fsf@gitster.g>
Hi Junio, Derrick,
Thanks for the detailed review and suggestions.
On the fallback to `the_repository`: I agree with your observation that `istate->repo` being NULL would indicate a bug rather than a scenario to defensively handle. My initial intent was to be conservative in case there were edge paths where `istate->repo` might not be initialized, but given that INDEX_STATE_INIT(r) sets this unconditionally, it makes sense to rely on that invariant instead of masking potential issues. I will drop the fallback and use `istate->repo` directly (and verify via the test suite).
Regarding scope, Derrick’s suggestion to split this into separate commits makes sense. I’ll proceed as follows:
1. A focused patch that replaces `the_repository` with `istate->repo` in the trace2 calls within this file and removes the associated TODO comments.
2. A follow-up patch that replaces other uses of `the_repository` in places where an `istate` is already available (e.g., `refresh_index()`, `tweak_untracked_cache()`, `do_write_index()`, etc.), keeping changes logically grouped for easier review.
I’ll also run the full test suite after removing the fallback to confirm there are no hidden assumptions.
Junio, thanks also for pointing out the author identity. I’ll update it to use my real name in the next version.
Thanks again for the guidance.

Best, Jayesh

Previous: Junio C HamanoNext: Jayesh Daga via GitGitGadget
Message 4 of 14 in “read-cache: use index state repository for trace2 logging”
  1. read-cache: use index state repository for trace2 loggingJayesh Daga via GitGitGadget, Mar 27, 2026
  2. Derrick StoleeMar 27, 2026
  3. Junio C HamanoMar 27, 2026
  4. jayesh0104Mar 28, 2026
  5. read-cache: use istate->repo for trace2 loggingJayesh Daga via GitGitGadget, Mar 28, 2026
  6. Junio C HamanoMar 28, 2026
  7. Derrick StoleeMar 29, 2026
  8. 0/2 [GSoC] read-cache: use index state repository for trace2 loggingJayesh Daga via GitGitGadget, Mar 30, 2026
  9. 1/2 repo: add paths.git_dir repo info keyjayesh0104 via GitGitGadget, Mar 30, 2026
  10. 2/2 read-cache: use istate->repo for trace2 loggingJayesh Daga via GitGitGadget, Mar 30, 2026
  11. read-cache: use istate->repo for trace2 loggingJayesh Daga via GitGitGadget, Mar 30, 2026
  12. Junio C HamanoMar 30, 2026
  13. Derrick StoleeApr 2, 2026
  14. Jayesh DagaApr 2, 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.