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

[RFC] repo: path representation in `git repo info` (absolute vs relative)

From
jayesh0104 <jayeshdaga99@gmail.com>
Date
Mar 18, 2026, 06:55 UTC
Message-ID
<20260318065545.10001-3-jayeshdaga99@gmail.com>
From: Jayesh Daga <jayeshdaga99@gmail.com>
Hi,

While working on extending `git repo info` to include additional path-related values (e.g., `paths.common_dir`, `paths.toplevel`, and `--git-path` equivalents), I wanted to clarify the expected representation of paths before proceeding further.

Currently, commands like `git rev-parse` may return paths relative to the current working directory depending on context. In contrast, some internal APIs operate on absolute paths.

This raises a design question for `git repo info`:
  Should path-related values be returned as:
  1. Relative paths (consistent with `rev-parse` behavior and more portable), or
  2. Absolute paths (more explicit and unambiguous)?
One possible approach is:
  - Default to relative paths for consistency and portability
  - Provide an optional flag (e.g., `--absolute`) to return absolute paths

This would allow flexibility while maintaining compatibility with existing expectations.

I would appreciate feedback on the preferred approach before proceeding with additional path-related keys.

Thanks, Jayesh

Message 1 of 1 in “[RFC] repo: path representation in `git repo info` (absolute vs relative)”
  1. jayesh0104Mar 18, 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.