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

[PATCH 0/3] contrib/subtree: reduce recursion during split

From
CSColin Stagner <ask+git@howdoi.land>
Date
Feb 15, 2026, 20:17 UTC
Message-ID
<20260215201748.889866-1-ask+git@howdoi.land>
* cs/subtree-split-recursion: when processing large history
  graphs on Debian or Ubuntu, "git subtree" can die with a
  "recursion depth reached" error. Reduce recursion.

On Debian's POSIX sh, shell recursion is artificially limited to 1000 calls. You can check if your sh has limited recursion with:

    #!/bin/sh
    recurse() {
        r=$(( r + 1 ))
        test "$r" -le 1000 || { echo OK; exit; }
        recurse
    } && r=0 && recurse

Depending on the history graph, subtree split can recurse deeply enough to encounter this limit. Rewrite the rejoin-deepening algorithm to reduce recursive calls.

Colin Stagner (3):
  contrib/subtree: reduce function side-effects
  contrib/subtree: functionalize split traversal
  contrib/subtree: reduce recursion during split
 contrib/subtree/git-subtree.sh | 95 +++++++++++++++++++++++++++++++---
 1 file changed, 88 insertions(+), 7 deletions(-)
base-commit: 852829b3dd2fe4e7c7fc4d8badde644cf1b66c74
-- 
2.43.0
Next: Colin Stagner
Message 1 of 4 in “contrib/subtree: reduce recursion during split”
  1. 0/3 contrib/subtree: reduce recursion during splitColin Stagner, Feb 15, 2026
  2. 2/3 contrib/subtree: functionalize split traversalColin Stagner, Feb 15, 2026
  3. 1/3 contrib/subtree: reduce function side-effectsColin Stagner, Feb 15, 2026
  4. 3/3 contrib/subtree: reduce recursion during splitColin Stagner, Feb 15, 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.