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>

Junio C Hamano committed Feb 16, 2024 at 09:22 UTC b3806f7633f69d44a2ade95b92ba21fb59362f4e
1 file changed +8 -2
Documentation/git.txt
+8 -2
@@ -174,8 +174,10 @@ If you just want to run git as if it was started in `<path>` then use
174 directory.
175
176 --no-replace-objects::
177 - Do not use replacement refs to replace Git objects. See
178 - linkgit:git-replace[1] for more information.
177 + Do not use replacement refs to replace Git objects.
178 + This is equivalent to exporting the `GIT_NO_REPLACE_OBJECTS`
179 + environment variable with any value.
180 + See linkgit:git-replace[1] for more information.
181
182 --no-lazy-fetch::
183 Do not fetch missing objects from the promisor remote on
@@ -873,6 +875,10 @@ for full details.
875 header and packfile URIs. Set this Boolean environment variable to false to prevent this
876 redaction.
877
878 +`GIT_NO_REPLACE_OBJECTS`::
879 + Setting and exporting this environment variable tells Git to
880 + ignore replacement refs and do not replace Git objects.
881 +
882 `GIT_LITERAL_PATHSPECS`::
883 Setting this Boolean environment variable to true will cause Git to treat all
884 pathspecs literally, rather than as glob patterns. For example,