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

[PATCH] Documentation: fix default value for core.maxTreeDepth

From
Taylor Blau <me@ttaylorr.com>
Date
Jul 17, 2024, 13:17 UTC
Message-ID
<57610d9ca635b6c76b9af5b3d3f346a9bc7621be.1721222249.git.me@ttaylorr.com>

When `core.maxTreeDepth` was originally introduced via be20128bfa (add core.maxTreeDepth config, 2023-08-31), its default value was 4096.

There have since been a couple of updates to its default value that were not reflected in the documentation for `core.maxTreeDepth`:

  - 4d5693ba05 (lower core.maxTreeDepth default to 2048, 2023-08-31)
  - b64d78ad02 (max_tree_depth: lower it for MSVC to avoid stack
    overflows, 2023-11-01)

Commit 4d5693ba05 lowers the default to 2048 for platforms with smaller stack sizes, and commit b64d78ad02 lowers the default even further when Git is compiled with MSVC.

Neither of these changes were reflected in the documentation, which I noticed while merging newer releases back into GitHub's private fork (which contained the original implementation of `core.maxTreeDepth`).

Update the documentation to reflect what the platform-specific default values are.

Noticed-by: Keith W. Campbell <keithc@ca.ibm.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
---
 Documentation/config/core.txt | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Documentation/config/core.txt b/Documentation/config/core.txt
index 93d65e1dfd..60ca9f2b68 100644
--- a/Documentation/config/core.txt
+++ b/Documentation/config/core.txt
@@ -756,4 +756,5 @@ core.maxTreeDepth::
 	The maximum depth Git is willing to recurse while traversing a
 	tree (e.g., "a/b/cde/f" has a depth of 4). This is a fail-safe
 	to allow Git to abort cleanly, and should not generally need to
-	be adjusted. The default is 4096.
+	be adjusted. When Git is compiled with MSVC, the default is 512.
+	Otherwise, the default is 2048.
-- 
2.45.2.746.g06e570c0df
Message 1 of 1 in “Documentation: fix default value for core.maxTreeDepth”
  1. Documentation: fix default value for core.maxTreeDepthTaylor Blau, Jul 17, 2024

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.