git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 17:29 UTC

Re: [PATCH 0/4] repo: add support for path-related fields

From
AJAyush Jha <kumarayushjha123@gmail.com>
Date
Mar 3, 2026, 03:27 UTC
Message-ID
<CAFNBzOeDU3BGdZjP0edvcd6OZxrP0VgN=AHSYTFseoKdMdu70g@mail.gmail.com>
In-Reply-To
<B46AA932-28EF-4A2C-96B9-0F05D9641C1C@gmail.com>
Hi Lucas,

I completely agree that having --all dump three variants of every path (default, relative, absolute) would be far too noisy and defeat the purpose of a clean metadata dump.

My thought is that the path.absolute.* and path.relative.* keys could be treated as "virtual" or computed keys.

If a user runs --all, the command would only iterate over and print the base keys (e.g., path.toplevel, path.git-dir). The specific format variants would simply be hidden from the iteration list, much like how some APIs only return expensive or highly-specific fields if they are explicitly requested.

This way, --all stays perfectly clean and concise, but scripts that need mixed granular control can still invoke git repo info path.absolute.git-dir path.relative.toplevel in a single pass without relying on global state flags.

Do you think treating them as explicit-request-only fields strikes the right balance between a clean --all output and a stateless API?

On Mon, Mar 2, 2026 at 1:25 AM Lucas Seiki Oshiro <lucasseikioshiro@gmail.com> wrote:

Show 21 quoted lines
>
>
> > Hi Lucas,
>
> Hi, Ayush!
>
> > Thanks for sharing this series — moving the path formatting logic into
> > path.c makes a lot of sense and avoids duplication with rev-parse.
>
> Yeah, but since git-repo-info was written as a better home for
> some features currently in git-rev-parse, now we can think in
> better solutions.
>
> > For example, something along the lines of:
> > path.toplevel
> > path.absolute.toplevel
> > path.relative.toplevel
>
> I also thought about that, but what would happen with --all?
> If --all returns both absolute and relative, then we would
> have the third solution.
Previous: JAYATHEERTH KNext: Tian Yuchen
Message 21 of 26 in “repo: add support for path-related fields”
  1. 0/4 repo: add support for path-related fieldsLucas Seiki Oshiro, Feb 28, 2026
  2. 1/4 rev-parse: prepend `path_` to path-related enumsLucas Seiki Oshiro, Feb 28, 2026
  3. 2/4 path: add new function strbuf_add_pathLucas Seiki Oshiro, Feb 28, 2026
  4. 3/4 repo: add the --format-path flagLucas Seiki Oshiro, Feb 28, 2026
  5. 4/4 repo: add the field path.toplevelLucas Seiki Oshiro, Feb 28, 2026
  6. JAYATHEERTH KMar 1, 2026
  7. Tian YuchenMar 1, 2026
  8. Ayush JhaMar 1, 2026
  9. JAYATHEERTH KMar 1, 2026
  10. Phillip WoodMar 1, 2026
  11. Lucas Seiki OshiroMar 1, 2026
  12. Lucas Seiki OshiroMar 1, 2026
  13. Lucas Seiki OshiroMar 1, 2026
  14. Lucas Seiki OshiroMar 1, 2026
  15. brian m. carlsonMar 1, 2026
  16. Tian YuchenMar 2, 2026
  17. Junio C HamanoMar 2, 2026
  18. Tian YuchenMar 2, 2026
  19. Junio C HamanoMar 2, 2026
  20. JAYATHEERTH KMar 3, 2026
  21. Ayush JhaMar 3, 2026
  22. Tian YuchenMar 3, 2026
  23. JAYATHEERTH KMar 3, 2026
  24. Tian YuchenMar 3, 2026
  25. JAYATHEERTH KMar 3, 2026
  26. Lucas Seiki OshiroMar 8, 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.