Re: [GSoC Patch v2 5/7] repo: add path.index with absolute and relative suffix formatting
From: K Jayatheerth <hidden>
Date: 2026-07-24 17:49:31
Hey Lucas and Junio, On Mon, Jul 20, 2026 at 6:05 AM Lucas Seiki Oshiro [off-list ref] wrote:
quoted
Introduce `path.index.absolute` and `path.index.relative` keys to `git repo info`. This allows tooling utilities to discover the active index context cleanly while scaling transparently with localized `GIT_INDEX_FILE` environment overrides.Note that bare repositories doesn't need to have an index file. Maybe it would be better if you return an empty value in those cases.
I wanted to follow up on this series. I am a bit unsure about how to proceed with this specific case, especially after Junio's feedback on the grafts patch. For path.grafts, Junio mentioned that we should return the expected path even if the file doesn't exist yet, so scripts know where to write it. I am wondering if a similar logic should apply to path.index in bare repositories. While bare repos don't have a working tree (and therefore usually no index), scripts do sometimes set GIT_INDEX_FILE to build temporary indexes for tree manipulation. Should we strictly return an empty string for bare repos (similar to how we handle path.toplevel), or should we return the default <gitdir>/index path in case a script wants to know where it would be? If this confusion is clear I can send a new version! Thank you, Regards - K Jayatheerth