git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.

Previous: Matt Hunter
Message 3 of 3 in “clone: accept DEPTH env var as fallback for --depth”
  1. clone: accept DEPTH env var as fallback for --depthh8d13 via GitGitGadget, Jun 13, 2026
  2. Matt HunterJun 13, 2026
  3. Junio C HamanoJun 13, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.