Re: [PATCH] read-cache: avoid sparse-index expansion for unborn HEAD
- From
Sahitya Chandra <sahityajb@gmail.com>
- Date
- Aug 7, 2026, 08:05 UTC
- Message-ID
- <CAP=WS+sp74WQ=xndQ+2a6W-qP3Zz8=bVnEymgVpS+gwMv1Dh7g@mail.gmail.com>
- In-Reply-To
- <CABPp-BGYuQA_ngR3xS-_Mndzf_ubkn7rSc25CJG=UbLCVGdnyg@mail.gmail.com>
On Fri, Aug 7, 2026 at 12:17 PM Elijah Newren <newren@gmail.com> wrote:
> > This explains what, but not why. It feels like a pedagogical exercise > with no actual utility.
You are right, I found this through the TODO comment and do not have a concrete user bug report or use case driving it.
> Why would someone with an unborn HEAD be using a sparse index? [...]
I do not have a good answer to that. My thinking was simply that removing the special-case fallback still has some value: it deletes a long-standing TODO, unifies the unborn-branch path with the normal diff path, and removes an ensure_full_index() call that future readers would need to reason about.
> This seems to presume a single dirty file, otherwise wouldn't the > printing look pretty odd?
I agree that "dirty=%s" looks wrong when multiple paths are present. I can fix that in v2.
Thanks for the review.