git: document GIT_NO_REPLACE_OBJECTS environment variable

This variable is used as the primary way to disable the object
replacement mechanism, with the "--no-replace-objects" command line
option as an end-user visible way to set it, but has not been
documented.

The original reason why it was left undocumented might be because it
was meant as an internal implementation detail, but the thing is,
that our tests use the environment variable directly without the
command line option, and there certainly are folks who learned its
use from there, making it impossible to deprecate or change its
behaviour by now.

Add documentation and note that for this variable, unlike many
boolean-looking environment variables, only the presence matters,
not what value it is set to.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Junio C Hamano 2024-02-16 09:22:20 -08:00
parent c784b0a5b9
commit b3806f7633
1 changed files with 8 additions and 2 deletions

View File

@ -174,8 +174,10 @@ If you just want to run git as if it was started in `<path>` then use
directory.

--no-replace-objects::
Do not use replacement refs to replace Git objects. See
linkgit:git-replace[1] for more information.
Do not use replacement refs to replace Git objects.
This is equivalent to exporting the `GIT_NO_REPLACE_OBJECTS`
environment variable with any value.
See linkgit:git-replace[1] for more information.

--no-lazy-fetch::
Do not fetch missing objects from the promisor remote on
@ -873,6 +875,10 @@ for full details.
header and packfile URIs. Set this Boolean environment variable to false to prevent this
redaction.

`GIT_NO_REPLACE_OBJECTS`::
Setting and exporting this environment variable tells Git to
ignore replacement refs and do not replace Git objects.

`GIT_LITERAL_PATHSPECS`::
Setting this Boolean environment variable to true will cause Git to treat all
pathspecs literally, rather than as glob patterns. For example,