Volume XXII, number 280Wednesday, October 7, 2026Latest message 2 hours ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

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

1 messages between Mar 18, 2026 and Mar 18, 2026, from jayesh0104.

Plain Markdown or JSON for tools and agents.

jayesh0104Mar 18, 2026, 06:55 UTC on lore
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

Back to recent threads

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