Re: [GSoC PATCH v4 6/7] repo: add path.git-prefix
From: K Jayatheerth <hidden>
Date: 2026-08-21 14:08:19
On Tue, Aug 18, 2026 at 10:39 PM Junio C Hamano [off-list ref] wrote:
K Jayatheerth [off-list ref] writes:quoted
On Sun, Aug 16, 2026 at 6:24 AM Lucas Seiki Oshiro [off-list ref] wrote:quoted
quoted
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?
Very true, I agree with you. I believe cdup and git-prefix complement each other well, so it makes sense to expose both.
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.
Sure, I will add cdup in the next version and send it. Thank you! - K Jayatheerth