Re: [GSoC PATCH v4 6/7] repo: add path.git-prefix

K Jayatheerth <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <CA+rGoLcFojrG4yfFG2OB+p-qJie==-Xz89Cysjz1mTLw8Xzukw@mail.gmail.com>
On Tue, Aug 18, 2026 at 10:39 PM Junio C Hamano <[email protected]> wrote:
>
> 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?
>

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.