Re: [PATCH 0/4] repo: add support for path-related fields
- From
Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
- Date
- Mar 1, 2026, 19:40 UTC
- Message-ID
- <491CD222-D595-4408-B78C-72E4C3DA0A62@gmail.com>
- In-Reply-To
- <c074cec5-eaac-49d0-89cc-d2ac9d605e59@gmail.com>
> Hi Lucas
Hi, Phillip!
> How does this effort relate to similar effort at at > https://lore.kernel.org/pull.2208.v5.git.git.1772220640.gitgitgadget@gmail.com ?
I have this patch series started since July, but I could only send this after having my two previous changes in git-repo-info accepted.
I think that patch series you mentioned is based on some previous message (or the GSoC project ideas) where I listed what was still need to be implemented. It uses a similar --path-format flag, but without dealing with the multiple possibilities currently used by git-rev-parse (see [1]).
The original print_path from git-rev-parse has four possible default formats (relative, relative if there's a shared root, canonical (absolute), and unmodified), and we can force it to use the relative or absolute formats. If I understood it correctly, this complex logic was added ([1]) to allow the user to force one of these two formats without breaking the default behavior. Since git-repo-info is a new command, we are free from being compatible with that, and perhaps this doesn't make sense.
Since there are many people interested in contributing to git-repo-info, especially in the path-* fields, I just wanted to finish what I have here and leave the rest for them :-)
Show 6 quoted lines
>> 1. Add --path-format, just like we have in git-rev-parse > > I think that's the best solution. Having different defaults > for different paths like rev-parse is confusing and having > different keys for absolute and relative versions of the > same path gets rather verbose.
I agree, but I still think that it feels weird that we won't be able return absolute and relative paths in a single git-repo-info call. But it also won't cost too much to call it twice.
> Thanks
Thanks, Phillip! Phillip
PS: I'm also CC'ing:
- Eslam (the author of the patch mentioned by Phillip) - Karthik, Justin, Ayush, and Siddhart (possible mentors for "Improve the new git repo command") - Patrick, who was my GSoC mentor and the person I first discussed with about --path-format
[1] fac60b8925 (rev-parse: add option for absolute or relative path formatting, 2020-12-13)