Skip to content

Commit a2a6768

Browse files
docs: describe repo info path keys
Document repo info category keys, path.* keys, and --path-format behavior. Signed-off-by: Eslam reda ragheb <eslam.reda.div@gmail.com>
1 parent 6ea263f commit a2a6768

File tree

1 file changed

+56
-4
lines changed

1 file changed

+56
-4
lines changed

Documentation/git-repo.adoc

Lines changed: 56 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ git-repo - Retrieve information about the repository
88
SYNOPSIS
99
--------
1010
[synopsis]
11-
git repo info [--format=(keyvalue|nul) | -z] [--all | <key>...]
11+
git repo info [--format=(keyvalue|nul) | -z] [--path-format=(absolute|relative)] [--all | <key>...]
1212
git repo structure [--format=(table|keyvalue|nul) | -z]
1313

1414
DESCRIPTION
@@ -44,6 +44,11 @@ supported:
4444
+
4545
`-z` is an alias for `--format=nul`.
4646

47+
`--path-format=(absolute|relative)`:::
48+
Controls formatting for keys in the `path` category. The default is
49+
`absolute`. This option may be specified multiple times; the last one
50+
specified takes effect.
51+
4752
`structure [--format=(table|keyvalue|nul) | -z]`::
4853
Retrieve statistics about the current repository structure. The
4954
following kinds of information are reported:
@@ -78,9 +83,11 @@ supported:
7883

7984
INFO KEYS
8085
---------
81-
In order to obtain a set of values from `git repo info`, you should provide
82-
the keys that identify them. Here's a list of the available keys and the
83-
values that they return:
86+
In order to obtain values from `git repo info`, provide either individual keys
87+
or category names. A category returns all keys within that category. For
88+
example, `layout` returns both `layout.bare` and `layout.shallow`.
89+
90+
Here's a list of the available keys and the values that they return:
8491

8592
`layout.bare`::
8693
`true` if this is a bare repository, otherwise `false`.
@@ -91,6 +98,51 @@ values that they return:
9198
`object.format`::
9299
The object format (hash algorithm) used in the repository.
93100

101+
`path.common-dir`::
102+
The path to the common git directory.
103+
104+
`path.config-file`::
105+
The path to the `config` file in the git directory.
106+
107+
`path.git-dir`::
108+
The path to the git directory.
109+
110+
`path.git-prefix`::
111+
The path of the current working directory relative to the top-level
112+
directory.
113+
114+
`path.grafts-file`::
115+
The path to the `info/grafts` file.
116+
117+
`path.hooks-directory`::
118+
The path to the `hooks` directory.
119+
120+
`path.index-file`::
121+
The path to the index file.
122+
123+
`path.logs-directory`::
124+
The path to the `logs` directory.
125+
126+
`path.objects-directory`::
127+
The path to the objects directory.
128+
129+
`path.packed-refs-file`::
130+
The path to the `packed-refs` file.
131+
132+
`path.refs-directory`::
133+
The path to the `refs` directory.
134+
135+
`path.shallow-file`::
136+
The path to the `shallow` file.
137+
138+
`path.superproject-working-tree`::
139+
The path to the superproject's working tree root, or an empty string
140+
when the repository is not used as a submodule.
141+
142+
`path.toplevel`::
143+
The path to the top-level working tree directory, or an empty string
144+
for bare repositories.
145+
94146
`references.format`::
95147
The reference storage format. The valid values are:
96148
+

0 commit comments

Comments
 (0)