Re: [GSoC PATCH v4 6/7] repo: add path.git-prefix
Junio C Hamano <[email protected]>
| Newsgroups | org.kernel.vger.git |
|---|---|
| Message-ID | <[email protected]> |
K Jayatheerth <[email protected]> writes: > On Sun, Aug 16, 2026 at 6:24 AM Lucas Seiki Oshiro > <[email protected]> wrote: >> >> >> > Scripts sometimes need the path from the repository's working tree root >> > to the current working directory. While this information can be derived >> > through existing Git commands, `git repo info` does not currently expose >> > it as a scriptable key. >> >> Even though I understand that this is a relevant info, it seems >> to me that it's a little bit out of place here... This is >> a "current directory information", not a "repository information". > > I agree that path.git-prefix is technically current-directory information > rather than repository information. The same thing can be said about "git rev-parse --show-cdup"; you can complain that it is about the current working directory, but in reality it is about how to get to the root of the working tree you are currently working in, which means that it is very much about repository information, only given as a relative path. Nobody would complain that you have 'path.commondir.relative' when you already offer its '.absolute' counterpart, saying that '.relative' is about your current working directory and not about the repository, right? The same story holds for 'path.git-prefix', I would think. View it, and "git rev-parse --show-prefix", as the inverse version of a 'path.root-of-the-working-tree.relative' (aka 'path.cdup') rather than as being about the "current directory". Oh, and if you are offering git-prefix, you should offer cdup as well. Thanks.