Skip to content

Commit 19f5ce0

Browse files
calebdwttaylorr
authored andcommitted
doc: consolidate extensions in git-config documentation
The `technical/repository-version.txt` document originally served as the master list for extensions, requiring that any new extensions be defined there. However, the `config/extensions.txt` file was introduced later and has since become the de facto location for describing extensions, with several extensions listed there but missing from `repository-version.txt`. This consolidates all extension definitions into `config/extensions.txt`, making it the authoritative source for extensions. The references in `repository-version.txt` are updated to point to `config/extensions.txt`, and cross-references to related documentation such as `gitrepository-layout[5]` and `git-config[1]` are added. Suggested-by: Junio C Hamano <[email protected]> Signed-off-by: Caleb White <[email protected]> Signed-off-by: Taylor Blau <[email protected]>
1 parent 34b6ce9 commit 19f5ce0

File tree

6 files changed

+62
-64
lines changed

6 files changed

+62
-64
lines changed

Documentation/config/core.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ default in a bare repository.
366366

367367
core.repositoryFormatVersion::
368368
Internal variable identifying the repository format and layout
369-
version.
369+
version. See linkgit:gitrepository-layout[5].
370370

371371
core.sharedRepository::
372372
When 'group' (or 'true'), the repository is made shareable between

Documentation/config/extensions.txt

Lines changed: 54 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,69 @@
1-
extensions.objectFormat::
2-
Specify the hash algorithm to use. The acceptable values are `sha1` and
3-
`sha256`. If not specified, `sha1` is assumed. It is an error to specify
4-
this key unless `core.repositoryFormatVersion` is 1.
1+
extensions.*::
2+
Unless otherwise stated, is an error to specify an extension if
3+
`core.repositoryFormatVersion` is not `1`. See
4+
linkgit:gitrepository-layout[5].
55
+
6-
Note that this setting should only be set by linkgit:git-init[1] or
7-
linkgit:git-clone[1]. Trying to change it after initialization will not
8-
work and will produce hard-to-diagnose issues.
9-
10-
extensions.compatObjectFormat::
11-
6+
--
7+
compatObjectFormat::
128
Specify a compatibility hash algorithm to use. The acceptable values
139
are `sha1` and `sha256`. The value specified must be different from the
14-
value of extensions.objectFormat. This allows client level
10+
value of `extensions.objectFormat`. This allows client level
1511
interoperability between git repositories whose objectFormat matches
1612
this compatObjectFormat. In particular when fully implemented the
1713
pushes and pulls from a repository in whose objectFormat matches
1814
compatObjectFormat. As well as being able to use oids encoded in
1915
compatObjectFormat in addition to oids encoded with objectFormat to
2016
locally specify objects.
2117

22-
extensions.refStorage::
18+
noop::
19+
This extension does not change git's behavior at all. It is useful only
20+
for testing format-1 compatibility.
21+
+
22+
For historical reasons, this extension is respected regardless of the
23+
`core.repositoryFormatVersion` setting.
24+
25+
noop-v1::
26+
This extension does not change git's behavior at all. It is useful only
27+
for testing format-1 compatibility.
28+
29+
objectFormat::
30+
Specify the hash algorithm to use. The acceptable values are `sha1` and
31+
`sha256`. If not specified, `sha1` is assumed.
32+
+
33+
Note that this setting should only be set by linkgit:git-init[1] or
34+
linkgit:git-clone[1]. Trying to change it after initialization will not
35+
work and will produce hard-to-diagnose issues.
36+
37+
partialClone::
38+
When enabled, indicates that the repo was created with a partial clone
39+
(or later performed a partial fetch) and that the remote may have
40+
omitted sending certain unwanted objects. Such a remote is called a
41+
"promisor remote" and it promises that all such omitted objects can
42+
be fetched from it in the future.
43+
+
44+
The value of this key is the name of the promisor remote.
45+
+
46+
For historical reasons, this extension is respected regardless of the
47+
`core.repositoryFormatVersion` setting.
48+
49+
preciousObjects::
50+
If enabled, indicates that objects in the repository MUST NOT be deleted
51+
(e.g., by `git-prune` or `git repack -d`).
52+
+
53+
For historical reasons, this extension is respected regardless of the
54+
`core.repositoryFormatVersion` setting.
55+
56+
refStorage::
2357
Specify the ref storage format to use. The acceptable values are:
2458
+
2559
include::../ref-storage-format.txt[]
26-
+
27-
It is an error to specify this key unless `core.repositoryFormatVersion` is 1.
60+
2861
+
2962
Note that this setting should only be set by linkgit:git-init[1] or
3063
linkgit:git-clone[1]. Trying to change it after initialization will not
3164
work and will produce hard-to-diagnose issues.
3265

33-
extensions.worktreeConfig::
66+
worktreeConfig::
3467
If enabled, then worktrees will load config settings from the
3568
`$GIT_DIR/config.worktree` file in addition to the
3669
`$GIT_COMMON_DIR/config` file. Note that `$GIT_COMMON_DIR` and
@@ -40,23 +73,25 @@ extensions.worktreeConfig::
4073
`config.worktree` file will override settings from any other
4174
config files.
4275
+
43-
When enabling `extensions.worktreeConfig`, you must be careful to move
76+
When enabling this extension, you must be careful to move
4477
certain values from the common config file to the main working tree's
4578
`config.worktree` file, if present:
4679
+
4780
* `core.worktree` must be moved from `$GIT_COMMON_DIR/config` to
4881
`$GIT_COMMON_DIR/config.worktree`.
4982
* If `core.bare` is true, then it must be moved from `$GIT_COMMON_DIR/config`
5083
to `$GIT_COMMON_DIR/config.worktree`.
84+
5185
+
5286
It may also be beneficial to adjust the locations of `core.sparseCheckout`
5387
and `core.sparseCheckoutCone` depending on your desire for customizable
5488
sparse-checkout settings for each worktree. By default, the `git
55-
sparse-checkout` builtin enables `extensions.worktreeConfig`, assigns
89+
sparse-checkout` builtin enables this extension, assigns
5690
these config values on a per-worktree basis, and uses the
5791
`$GIT_DIR/info/sparse-checkout` file to specify the sparsity for each
5892
worktree independently. See linkgit:git-sparse-checkout[1] for more
5993
details.
6094
+
61-
For historical reasons, `extensions.worktreeConfig` is respected
62-
regardless of the `core.repositoryFormatVersion` setting.
95+
For historical reasons, this extension is respected regardless of the
96+
`core.repositoryFormatVersion` setting.
97+
--

Documentation/gitrepository-layout.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ SEE ALSO
298298
--------
299299
linkgit:git-init[1],
300300
linkgit:git-clone[1],
301+
linkgit:git-config[1],
301302
linkgit:git-fetch[1],
302303
linkgit:git-pack-refs[1],
303304
linkgit:git-gc[1],

Documentation/technical/hash-function-transition.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Detailed Design
148148
Repository format extension
149149
~~~~~~~~~~~~~~~~~~~~~~~~~~~
150150
A SHA-256 repository uses repository format version `1` (see
151-
Documentation/technical/repository-version.txt) with extensions
152-
`objectFormat` and `compatObjectFormat`:
151+
linkgit:gitrepository-layout[5]) with `extensions.objectFormat` and
152+
`extensions.compatObjectFormat` (see linkgit:git-config[1]) set to:
153153

154154
[core]
155155
repositoryFormatVersion = 1

Documentation/technical/partial-clone.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ or commits that reference missing trees.
102102
- On the client a repository extension is added to the local config to
103103
prevent older versions of git from failing mid-operation because of
104104
missing objects that they cannot handle.
105-
See "extensions.partialClone" in Documentation/technical/repository-version.txt"
105+
See `extensions.partialClone` in linkgit:git-config[1].
106106

107107

108108
Handling Missing Objects

Documentation/technical/repository-version.txt

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -65,44 +65,6 @@ Note that if no extensions are specified in the config file, then
6565
provides no benefit, and makes the repository incompatible with older
6666
implementations of git).
6767

68-
This document will serve as the master list for extensions. Any
69-
implementation wishing to define a new extension should make a note of
70-
it here, in order to claim the name.
71-
72-
The defined extensions are:
73-
74-
==== `noop`
75-
76-
This extension does not change git's behavior at all. It is useful only
77-
for testing format-1 compatibility.
78-
79-
==== `preciousObjects`
80-
81-
When the config key `extensions.preciousObjects` is set to `true`,
82-
objects in the repository MUST NOT be deleted (e.g., by `git-prune` or
83-
`git repack -d`).
84-
85-
==== `partialClone`
86-
87-
When the config key `extensions.partialClone` is set, it indicates
88-
that the repo was created with a partial clone (or later performed
89-
a partial fetch) and that the remote may have omitted sending
90-
certain unwanted objects. Such a remote is called a "promisor remote"
91-
and it promises that all such omitted objects can be fetched from it
92-
in the future.
93-
94-
The value of this key is the name of the promisor remote.
95-
96-
==== `worktreeConfig`
97-
98-
If set, by default "git config" reads from both "config" and
99-
"config.worktree" files from GIT_DIR in that order. In
100-
multiple working directory mode, "config" file is shared while
101-
"config.worktree" is per-working directory (i.e., it's in
102-
GIT_COMMON_DIR/worktrees/<id>/config.worktree)
103-
104-
==== `refStorage`
105-
106-
Specifies the file format for the ref database. The valid values are
107-
`files` (loose references with a packed-refs file) and `reftable` (see
108-
Documentation/technical/reftable.txt).
68+
The defined extensions are given in the `extensions.*` section of
69+
linkgit:git-config[1]. Any implementation wishing to define a new
70+
extension should make a note of it there, in order to claim the name.

0 commit comments

Comments
 (0)