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

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

From
JAYATHEERTH K <jayatheerthkulkarni2005@gmail.com>
Date
Mar 1, 2026, 06:50 UTC
Message-ID
<CA+rGoLcGB-iJX7U16NmONr_EhYLnsn0eNAAdcdExRLQtMv732w@mail.gmail.com>
In-Reply-To
<CAFNBzOdCx=R3r9+m5eDyAykMAbmbcfpX3kPeEPjqXPYT-_89+g@mail.gmail.com>
Hi Ayush,
On Sun, Mar 1, 2026 at 11:15 AM Ayush Jha <kumarayushjha123@gmail.com> wrote:
Show 21 quoted lines
>
> Hi Lucas,
>
> Thanks for sharing this series — moving the path formatting logic into
> path.c makes a lot of sense and avoids duplication with rev-parse.
>
> Regarding the limitation you mentioned about not being able to mix
> relative and absolute paths within the same invocation, I was
> wondering whether it might be worth considering making the path format
> part of the key itself, rather than controlled by a global flag.
>
> For example, something along the lines of:
> path.toplevel
> path.absolute.toplevel
> path.relative.toplevel
>
> This could allow users to request different formats in a single call
> without introducing global state into the command output.
> That said, I’m not sure whether this would complicate the key
> namespace too much, or whether maintaining parity with rev-parse
> semantics is preferable for consistency.

I think this idea works for individual retrieval It still won't work when the request is for --all The main problem of absolute vs relative would arrive from the --all perspective, no?

If a script specifically needs both formats for a set of paths, the caller can easily just invoke the command twice: i.e git repo info --path-format=absolute <keys...> git repo info --path-format=relative <keys...>

It would still work for individual path terms

I think adding the absolute or relative terms in key is more of a "user" friendly one.

What do you think about it?
Regards,
- Jayatheerth
Previous: Ayush JhaNext: Lucas Seiki Oshiro
Message 11 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. Tian YuchenMar 1, 2026
  7. Lucas Seiki OshiroMar 1, 2026
  8. Tian YuchenMar 2, 2026
  9. JAYATHEERTH KMar 1, 2026
  10. Ayush JhaMar 1, 2026
  11. JAYATHEERTH KMar 1, 2026
  12. Lucas Seiki OshiroMar 1, 2026
  13. Ayush JhaMar 3, 2026
  14. Lucas Seiki OshiroMar 1, 2026
  15. Phillip WoodMar 1, 2026
  16. Lucas Seiki OshiroMar 1, 2026
  17. brian m. carlsonMar 1, 2026
  18. Junio C HamanoMar 2, 2026
  19. Tian YuchenMar 2, 2026
  20. Junio C HamanoMar 2, 2026
  21. JAYATHEERTH KMar 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.