Re: [RFC] git repo info: exposing repository paths
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Feb 11, 2026, 12:18 UTC
- Message-ID
- <aYxzmjoxQHccqTAl@pks.im>
- In-Reply-To
- <CALE2CrTt_2-9C4zCrZPBabtsWY=+Mk-bH4Jaemk=yHtfpoLjfg@mail.gmail.com>
Hi,
On Tue, Feb 10, 2026 at 07:41:29PM +0530, Pushkar Singh wrote:
Show 21 quoted lines
> Hi all, > > I’ve been looking at the "git repo" command recently, mostly comparing > "git repo info" with what I usually reach for via "git rev-parse". > > One thing I noticed is that git repo info currently reports repository > properties like layout and formats, but none of the repository paths > that scripts often need. > > For example, as of now: > > git rev-parse --git-dir > git rev-parse --common-dir > git rev-parse --git-path hooks > > are commonly used by scripts and tooling to figure out where things > actually live on disk. > > I wanted to ask whether it would make sense for git repo info to > eventually expose some of these as structured keys, starting with > something minimal like "git-dir".
Yes! git-rev-parse(1) has been growing functionality over time that simply doesn't have anything to do with revisions, so I think it's good to give such functionality a new home in git-repo(1). This has been kind of the original idea behind this command.
Show 8 quoted lines
> My idea is not to completely replace rev-parse, but to let "git repo > info" act as a more discoverable, descriptive interface for repository > metadata, including paths, where appropriate. > > One question I am unsure about is whether such paths should be > reported as absolute or relative (for example, relative to the working > tree or invocation directory), and whether git-dir would be a > reasonable first step before considering others.
I know that Lucas had a bunch of thoughts around this. If I remember correctly, he wanted to add logic that basically allows the caller to choose whether the paths should be resolved to an absolute path or not. I've Cc'd him.
Thanks!
Patrick