From: Phillip Wood <phillip.wood123@gmail.com>
To: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>,
phillip.wood@dunelm.org.uk
Cc: git@vger.kernel.org, jltobler@gmail.com,
lucasseikioshiro@gmail.com, Junio C Hamano <gitster@pobox.com>
Subject: Re: [GSoC Patch v8 0/7] repo: add path keys to repo info
Date: Tue, 10 Nov 2026 14:40:22 +0000 [thread overview]
Message-ID: <f7489c12-8529-4d0b-b820-225c9ee4d297@gmail.com> (raw)
In-Reply-To: <CA+rGoLef6b35hjJAcO5Nm57NiyDGK-iDbWO2MUMeoKVCkbRf5A@mail.gmail.com>
On 09/11/2026 16:52, K Jayatheerth wrote:
> On Sun, Nov 8, 2026 at 1:27 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
>>>
>>> The path keys added in this series are:
>>> - `path.toplevel.absolute` / `path.toplevel.relative`: The root directory
>>> of the working tree (or an empty string in bare repositories).
>>
>> In our documentation and glossary, we call this directory the "working
>> tree" so I think "path.working-tree.*" would be a better name, rather
>> than copying the name from the equivalent rev-parse option.
>>
>>> - `path.superproject-root.absolute` / `path.superproject-root.relative`:
>>> The root of the superproject when inside a submodule.
>>
>> Personally, I'd prefer "path.superproject-working-tree.*" here, though I
>> see Justin thought that was a bit of a mouthful. As this command is for
>> use in scripts I'd rather have a descriptive name.
>>
>
> I don't have an opinion on the name itself, but, that said:
> I think superproject-working-tree is a more suiting name.
> It is becuase you may have a working tree in a different place and it
> might not be the root itself.
> I think the same logic applies for toplevel too.
>
> Any more thoughts from Justin, Lucas, Junio or any other reviewer
> would be better I reckon.
Yes, that would be helpful
>>> - `path.hooks.absolute` / `path.hooks.relative`: The repository's hooks
>>> directory (respecting `core.hooksPath`, including `/dev/null`).
>>
>> Given we have config based hooks now, do we really want to add this?
>> Scripts that want to run hooks should be using "git hook run" and
>> scripts that want to install hooks should be using the config based
>> hooks so that they co-exist with the user's existing hooks.
>>
>
> I believe that is a fair point for new tooling, though wouldn't many
> existing scripts
> and third-party tools still learn about hooks directly via `git
> rev-parse --git-path hooks`?
>
> Since the main goal of `git repo info` is to provide an alternative
> to `rev-parse`'s various path flags, `path.hooks` still seems useful for scripts
> migrating over, unless the consensus is to deprecate querying the hooks
> directory altogether.
Isn't the goal to provide a better interface than rev-parse, rather than
just porting the various path related options across unchanged? My worry
is that by adding "path.hooks.*" we're encouraging people to use an
outdated interface that ignores the existence of config based hooks.
Anyone who wants to keep using "git rev-parse --git-path hooks" can do
so, but I'd rather we didn't encourage that pattern by supporting it in
new commands.
>>> - `path.cdup`: The relative path from the current directory up to the
>>> worktree root.
>>
>> How does this differ from path.working-tree.relative? I've never really
>> understood "git rev-parse --cdup" - if you're in the repository root
>> directory, 'cd "$(git rev-parse --cdup)"' dumps you in your home
>> directory which has always seemed a bit surprising to me.
>>
>
> Well looking at the code itself
> What I can say is I find couple of edge cases,
>
> The cdup command relies on a slash counting loop on the prefix string
> to output directory-up
> sequences like '../', returns an empty string at the root and falls
> back to the worktree path when outside.
>
> On the contrary, relative formatting uses Git's path utility library
> to compute true relative
> filesystem paths, outputting '.' at the root instead of leaving it blank.
Right - but what practical benefit does "path.cdup" offer over
"path.working-tree.relative"? "git rev-parse --cdup" was added in
5f94c730f3 (rev-parse: --show-cdup, 2005-12-22), four years before
"--show-toplevel" in 7cceca5ccc (Add 'git rev-parse --show-toplevel'
option., 2010-01-12) and 15 years before support for relative paths in
fac60b8925 (rev-parse: add option for absolute or relative path
formatting, 2020-12-13). So when it was added "--cdup" was the only way
to find the root of the repository working tree, which is not the case now.
Thanks
Phillip
next prev parent reply other threads:[~2026-11-10 14:40 UTC|newest]
Thread overview: 125+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 1:21 [GSoC Patch 0/7] repo: add more path keys to git repo info K Jayatheerth
2026-07-16 1:21 ` [GSoC Patch 1/7] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-08-15 23:06 ` Lucas Seiki Oshiro
2026-08-18 16:09 ` K Jayatheerth
2026-07-16 1:21 ` [GSoC Patch 2/7] repo: add path.superproject-working-tree with absolute and relative suffixes K Jayatheerth
2026-07-16 1:21 ` [GSoC Patch 3/7] repo: add path.objects with absolute and relative suffix formatting K Jayatheerth
2026-07-16 1:21 ` [GSoC Patch 4/7] repo: add path.hooks " K Jayatheerth
2026-07-16 1:21 ` [GSoC Patch 5/7] repo: add path.index " K Jayatheerth
2026-07-16 1:21 ` [GSoC Patch 6/7] repo: add path.grafts " K Jayatheerth
2026-07-16 1:21 ` [GSoC Patch 7/7] repo: add path.git-prefix path key validation K Jayatheerth
2026-07-16 3:23 ` Junio C Hamano
2026-07-16 15:36 ` K Jayatheerth
2026-07-17 13:30 ` [GSoC Patch v2 0/7] repo: add more path keys to git repo info K Jayatheerth
2026-07-17 13:30 ` [GSoC Patch v2 1/7] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-07-17 13:30 ` [GSoC Patch v2 2/7] repo: add path.superproject-working-tree with absolute and relative suffixes K Jayatheerth
2026-07-17 13:30 ` [GSoC Patch v2 3/7] repo: add path.objects with absolute and relative suffix formatting K Jayatheerth
2026-07-17 13:30 ` [GSoC Patch v2 4/7] repo: add path.hooks " K Jayatheerth
2026-07-17 13:30 ` [GSoC Patch v2 5/7] repo: add path.index " K Jayatheerth
2026-07-20 0:35 ` Lucas Seiki Oshiro
2026-07-24 17:49 ` K Jayatheerth
2026-07-24 19:21 ` Junio C Hamano
2026-07-17 13:30 ` [GSoC Patch v2 6/7] repo: add path.grafts " K Jayatheerth
2026-07-20 0:20 ` Lucas Seiki Oshiro
2026-07-20 4:01 ` Junio C Hamano
2026-07-21 2:19 ` K Jayatheerth
2026-07-17 13:30 ` [GSoC Patch v2 7/7] repo: add path.git-prefix path key K Jayatheerth
2026-07-26 10:43 ` [GSoC Patch v3 0/7] repo: add more path keys to git repo info K Jayatheerth
2026-07-26 10:43 ` [PATCH v3 1/7] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-07-27 8:45 ` Junio C Hamano
2026-07-28 1:21 ` K Jayatheerth
2026-07-28 16:36 ` Justin Tobler
2026-07-29 16:36 ` K Jayatheerth
2026-07-26 10:43 ` [PATCH v3 2/7] repo: add path.superproject-working-tree with absolute and relative suffixes K Jayatheerth
2026-07-28 16:43 ` Justin Tobler
2026-07-26 10:43 ` [PATCH v3 3/7] repo: add path.objects with absolute and relative suffix formatting K Jayatheerth
2026-07-28 17:12 ` Justin Tobler
2026-07-26 10:43 ` [PATCH v3 4/7] repo: add path.hooks " K Jayatheerth
2026-07-28 19:00 ` Justin Tobler
2026-07-26 10:43 ` [PATCH v3 5/7] repo: add path.index " K Jayatheerth
2026-07-26 10:43 ` [PATCH v3 6/7] repo: add path.grafts " K Jayatheerth
2026-07-26 10:43 ` [PATCH v3 7/7] repo: add path.git-prefix path key K Jayatheerth
2026-07-26 16:29 ` [GSoC Patch v3 0/7] repo: add more path keys to git repo info Junio C Hamano
2026-07-26 17:00 ` K Jayatheerth
2026-07-27 0:57 ` Lucas Seiki Oshiro
2026-07-27 5:55 ` Junio C Hamano
2026-08-06 10:15 ` [GSoC PATCH v4 " K Jayatheerth
2026-08-06 10:15 ` [GSoC PATCH v4 1/7] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-08-06 10:15 ` [GSoC PATCH v4 2/7] repo: add path.superproject-root with absolute and relative suffixes K Jayatheerth
2026-08-06 10:15 ` [GSoC PATCH v4 3/7] repo: add path.hooks " K Jayatheerth
2026-08-06 10:15 ` [GSoC PATCH v4 4/7] repo: add path.index " K Jayatheerth
2026-08-06 10:15 ` [GSoC PATCH v4 5/7] repo: add path.grafts " K Jayatheerth
2026-08-06 10:15 ` [GSoC PATCH v4 6/7] repo: add path.git-prefix K Jayatheerth
2026-08-16 0:53 ` Lucas Seiki Oshiro
2026-08-18 16:33 ` K Jayatheerth
2026-08-18 17:09 ` Junio C Hamano
2026-08-21 14:08 ` K Jayatheerth
2026-08-06 10:15 ` [GSoC PATCH v4 7/7] repo: remove unused setup.h include K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 0/7] add more path keys to git repo info K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 1/7] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 2/7] repo: add path.superproject-root with absolute and relative suffixes K Jayatheerth
2026-09-04 22:09 ` Junio C Hamano
2026-09-05 10:01 ` K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 3/7] repo: add path.hooks " K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 4/7] repo: add path.index " K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 5/7] repo: add path.grafts " K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 6/7] repo: add path.git-prefix K Jayatheerth
2026-08-25 17:58 ` [GSoC Patch v5 7/7] repo: add path.cdup K Jayatheerth
2026-08-25 19:31 ` Junio C Hamano
2026-09-04 14:37 ` K Jayatheerth
2026-08-26 7:23 ` [GSoC Patch v5 0/7] add more path keys to git repo info SZEDER Gábor
2026-08-26 14:18 ` Junio C Hamano
2026-09-11 14:45 ` [GSoC Patch v6 " K Jayatheerth
2026-09-11 14:45 ` [GSoC Patch v6 1/7] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-09-11 14:45 ` [GSoC Patch v6 2/7] repo: add path.superproject-root with absolute and relative suffixes K Jayatheerth
2026-09-11 22:08 ` Junio C Hamano
2026-09-23 17:40 ` K Jayatheerth
2026-09-11 14:45 ` [GSoC Patch v6 3/7] repo: add path.hooks " K Jayatheerth
2026-09-11 14:45 ` [GSoC Patch v6 4/7] repo: add path.index " K Jayatheerth
2026-09-11 16:55 ` Junio C Hamano
2026-09-23 17:25 ` K Jayatheerth
2026-09-11 14:45 ` [GSoC Patch v6 5/7] repo: add path.grafts " K Jayatheerth
2026-09-11 14:45 ` [GSoC Patch v6 6/7] repo: add path.git-prefix K Jayatheerth
2026-09-11 14:45 ` [GSoC Patch v6 7/7] repo: add path.cdup K Jayatheerth
2026-09-11 17:37 ` Junio C Hamano
2026-09-23 17:37 ` K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 0/8] add more path keys to git repo info K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 1/8] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 2/8] submodule: use repository to find superproject K Jayatheerth
2026-11-02 21:36 ` Justin Tobler
2026-11-03 2:08 ` K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 3/8] repo: add path.superproject-root with absolute and relative suffixes K Jayatheerth
2026-11-02 21:43 ` Justin Tobler
2026-11-03 2:10 ` K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 4/8] repo: add path.hooks " K Jayatheerth
2026-11-02 22:32 ` Justin Tobler
2026-11-03 2:31 ` K Jayatheerth
2026-11-03 16:16 ` Justin Tobler
2026-11-03 18:27 ` K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 5/8] repo: add path.index " K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 6/8] repo: add path.grafts " K Jayatheerth
2026-11-02 22:47 ` Justin Tobler
2026-11-03 2:50 ` K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 7/8] repo: add path.git-prefix K Jayatheerth
2026-09-27 11:44 ` [GSoC Patch v7 8/8] repo: add path.cdup K Jayatheerth
2026-11-02 23:20 ` Justin Tobler
2026-11-03 2:54 ` K Jayatheerth
2026-11-01 23:30 ` [GSoC Patch v7 0/8] add more path keys to git repo info Junio C Hamano
2026-11-01 23:51 ` Justin Tobler
2026-11-02 9:31 ` Junio C Hamano
2026-11-07 16:00 ` [GSoC Patch v8 0/7] repo: add path keys to " K Jayatheerth
2026-11-07 16:00 ` [GSoC Patch v8 1/7] repo: add path.toplevel with absolute and relative suffix formatting K Jayatheerth
2026-11-07 16:00 ` [GSoC Patch v8 2/7] submodule: use repository to find superproject K Jayatheerth
2026-11-07 16:00 ` [GSoC Patch v8 3/7] repo: add path.superproject-root with absolute and relative suffixes K Jayatheerth
2026-11-07 16:00 ` [GSoC Patch v8 4/7] repo: add path.hooks " K Jayatheerth
2026-11-07 16:00 ` [GSoC Patch v8 5/7] repo: add path.index " K Jayatheerth
2026-11-07 16:00 ` [GSoC Patch v8 6/7] repo: add path.git-prefix K Jayatheerth
2026-11-07 16:01 ` [GSoC Patch v8 7/7] repo: add path.cdup K Jayatheerth
2026-11-07 19:57 ` [GSoC Patch v8 0/7] repo: add path keys to repo info Phillip Wood
2026-11-09 16:52 ` K Jayatheerth
2026-11-09 19:53 ` Junio C Hamano
2026-11-10 14:43 ` Phillip Wood
2026-11-11 9:05 ` K Jayatheerth
2026-11-10 14:40 ` Phillip Wood [this message]
2026-11-11 9:03 ` K Jayatheerth
2026-11-11 14:03 ` Phillip Wood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f7489c12-8529-4d0b-b820-225c9ee4d297@gmail.com \
--to=phillip.wood123@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jayatheerthkulkarni2005@gmail.com \
--cc=jltobler@gmail.com \
--cc=lucasseikioshiro@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox