git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [RFC] git repo info: exposing repository paths

From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
Date
Feb 18, 2026, 18:35 UTC
Message-ID
<20260218183511.17195-1-pushkarkumarsingh1970@gmail.com>
In-Reply-To
<aYxzmjoxQHccqTAl@pks.im>
Hi,
On Wed, Feb 11, 2026 at 01:18:34PM +0100, Patrick Steinhardt wrote:
> git-rev-parse(1) has been growing functionality over time that
> simply doesn't have anything to do with revisions, so I think it's good
> to give such functionality a new home in git-repo(1).

I spent some time going through the initial git-repo implementation thread [1], as well as Lucas's recent WIP series [2] adding "--format=default" and "--keys" support to "git repo info".

Looking at the current implementation, it seems that adding new values is primarily done by extending repo_info_fields[]. With the recent "--keys" support in place, that mechanism feels like the natural place to expose additional repository metadata.

In that direction, I would like to explore extending the existing "path.*" namespace with a few additional stable repository paths that are currently obtained through "git rev-parse", namely:

- path.git-dir
- path.common-dir
- path.objects-dir

These correspond to well-defined repository state and are already available via helpers such as repo_get_git_dir() and repo_get_common_dir(). The idea would be to add them as new entries in repo_info_fields[], reusing the existing output handling, without introducing new flags or changing the current structure.

For now, I am intentionally avoiding invocation-dependent values such as "git-prefix" or "is-inside-work-tree", and focusing only on paths derived directly from the repository instance.

Regarding relative versus absolute semantics, I would follow the direction of the ongoing "--path-format" discussion and align with whatever default behavior is agreed upon there.

If this sounds reasonable, I can prototype support for "path.git-dir" and "path.common-dir" first as a minimal step and continue the discussion based on that.

Thanks, Pushkar

[1] Initial git-repo introduction thread: https://public-inbox.org/git/20250610152117.14826-1-lucasseikioshiro@gmail.com/t/#u

[2] repo: add --format=default and --keys series: https://lore.kernel.org/git/aZLARuSCuy8wYLUA@pks.im/T/#u

Previous: Patrick SteinhardtNext: Pushkar Singh
Message 3 of 10 in “[RFC] git repo info: exposing repository paths”
  1. Pushkar SinghFeb 10, 2026
  2. Patrick SteinhardtFeb 11, 2026
  3. Pushkar SinghFeb 18, 2026
  4. 0/2 repo info: add path.git-dir and path.common-dirPushkar Singh, Mar 1, 2026
  5. 1/2 repo: add the field path.git-dirPushkar Singh, Mar 1, 2026
  6. 2/2 repo: add the field path.common-dirPushkar Singh, Mar 1, 2026
  7. K JayatheerthMar 1, 2026
  8. Lucas Seiki OshiroMar 1, 2026
  9. Pushkar SinghMar 1, 2026
  10. Junio C HamanoMar 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.