Re: [GSoC PATCH v4 6/7] repo: add path.git-prefix
- From
K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
- Date
- Aug 21, 2026, 14:08 UTC
- Message-ID
- <CA+rGoLcFojrG4yfFG2OB+p-qJie==-Xz89Cysjz1mTLw8Xzukw@mail.gmail.com>
- In-Reply-To
- <xmqqlda3z773.fsf@gitster.g>
On Tue, Aug 18, 2026 at 10:39 PM Junio C Hamano <gitster@pobox.com> wrote:
Show 28 quoted lines
> > K Jayatheerth <jayatheerthkulkarni2005@gmail.com> writes: > > > On Sun, Aug 16, 2026 at 6:24 AM Lucas Seiki Oshiro > > <lucasseikioshiro@gmail.com> 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? >
Very true, I agree with you. I believe cdup and git-prefix complement each other well, so it makes sense to expose both.
Show 8 quoted lines
> 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