Re: [PATCH] clone: accept DEPTH env var as fallback for --depth
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 13, 2026, 15:20 UTC
- Message-ID
- <xmqqeciafowq.fsf@gitster.g>
- In-Reply-To
- <DJ7MJMIFZR5N.2SG1RWB46WPQB@lfurio.us>
"Matt Hunter" <m@lfurio.us> writes:
Show 10 quoted lines
> On Fri Jun 12, 2026 at 9:39 PM EDT, h8d13 via GitGitGadget wrote:
>> @@ -1022,6 +1022,12 @@ int cmd_clone(int argc,
>> usage_msg_opt(_("You must specify a repository to clone."),
>> builtin_clone_usage, builtin_clone_options);
>>
>> + if (!option_depth) {
>> + const char *env_depth = getenv("DEPTH");
>
> Nearly all of the non-standard environment variables used by git start
> with "GIT_". "GIT_CLONE_DEPTH" may be a better choice.Isn't it sufficient to add a new configuration variable in the clone.* namespace? Unless there is a reason why it does not work, I won't accept a patch that adds a random environment support like this. We do not want to end up having to add other random environment variables like GIT_CLONE_DEFAULTREMOTENAME, CLONE_REJECTSHALLOW, CLONE_FILTERSUBMODULES for consistency.