]> git.ipfire.org Git - thirdparty/git.git/commit
repo: add path.git-prefix path key
authorK Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Sun, 26 Jul 2026 10:43:43 +0000 (16:13 +0530)
committerJunio C Hamano <gitster@pobox.com>
Sun, 26 Jul 2026 14:13:32 +0000 (07:13 -0700)
commit2cd8dac1317fcfea82ca8c65c54fa31cf0fd4928
tree6f7a71eb65abe0954acd759133b655d213d5309a
parentb93d827053a216a02d7d907c1cdf09b38e8b54bb
repo: add path.git-prefix path key

Scripts and command-line prompt integrations frequently need to know their
relative depth inside a repository working tree layout. Currently, this
is retrieved using `git rev-parse --show-prefix`.

Introduce the `path.git-prefix` key to `git repo info`. This mirrors the
prefix location tracking framework as a standalone key, returning the
exact relative path offset complete with a trailing slash, or an empty
string if run directly at the repository working tree root.

Mentored-by: Justin Tobler <jltobler@gmail.com>
Mentored-by: Lucas Seiki Oshiro <lucasseikioshiro@gmail.com>
Signed-off-by: K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-repo.adoc
builtin/repo.c
t/t1900-repo-info.sh