All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] contrib/subtree: reduce recursion during split
@ 2026-02-15 20:17 Colin Stagner
  2026-02-15 20:17 ` [PATCH 1/3] contrib/subtree: reduce function side-effects Colin Stagner
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Colin Stagner @ 2026-02-15 20:17 UTC (permalink / raw)
  To: git, Christian Heusel, george
  Cc: Colin Stagner, Christian Hesse, Phillip Wood, Junio C Hamano

* 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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-04-22 17:12 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-15 20:17 [PATCH 0/3] contrib/subtree: reduce recursion during split Colin Stagner
2026-02-15 20:17 ` [PATCH 1/3] contrib/subtree: reduce function side-effects Colin Stagner
2026-02-15 20:17 ` [PATCH 2/3] contrib/subtree: functionalize split traversal Colin Stagner
2026-02-15 20:17 ` [PATCH 3/3] contrib/subtree: reduce recursion during split Colin Stagner
2026-03-05 23:55 ` [PATCH v2 0/3] " Colin Stagner
2026-03-05 23:55   ` [PATCH v2 1/3] contrib/subtree: reduce function side-effects Colin Stagner
2026-03-05 23:55   ` [PATCH v2 2/3] contrib/subtree: functionalize split traversal Colin Stagner
2026-03-05 23:55   ` [PATCH v2 3/3] contrib/subtree: reduce recursion during split Colin Stagner
2026-03-13 22:51   ` [PATCH v2 0/3] " Junio C Hamano
2026-03-13 23:06     ` Junio C Hamano
2026-04-15 17:58       ` Junio C Hamano
2026-04-15 21:39         ` Ben Knoble
2026-04-16 13:25   ` Ian Jackson
2026-04-16 19:34     ` Junio C Hamano
2026-04-17  4:50     ` Colin Stagner
2026-04-19 19:55       ` Ian Jackson
2026-04-20  1:09         ` Ben Knoble
2026-04-20  1:50         ` Junio C Hamano
2026-04-20  9:57         ` Ian Jackson
2026-04-21  5:07           ` Colin Stagner
2026-04-22  9:43             ` Johannes Schindelin
2026-04-22 17:12           ` git-subtree rewrite Ian Jackson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.