]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git: document GIT_NO_REPLACE_OBJECTS environment variable
authorJunio C Hamano <gitster@pobox.com>
Fri, 16 Feb 2024 17:22:20 +0000 (09:22 -0800)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 Feb 2024 06:08:49 +0000 (22:08 -0800)
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>
Documentation/git.txt

index 95f451b22baa67b1c26f11a32f8ea636f7937281..b1f754e84bd94d792a0d762978942aecaf81ce69 100644 (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,