From: Tom Clarkson Date: Mon, 16 Dec 2019 03:50:04 GMT Subject: Re: Regression in git-subtree.sh, introduced in 2.20.1, after 315a84f9aa0e2e629b0680068646b0032518ebed Message-ID: <4F323B43-44AF-44C0-87DC-5A5C7C17FEB1@icloud.com> In-Reply-To: <5C8CA727-370E-4CEE-BBF9-F336C5921D98@icloud.com> I have put together a patch (currently testing on GitGitGadget) that at least fixes things for my repo - Commits from before subtree add are recognized as a dead end, so it no longer runs out of stack space while finding its way to a root commit. I think the issue Marc ran into is a bit more complex in that the recursion eventually producing the wrong result suggests that correct identification of mainline commits remains an issue. While I have some ideas on how to improve that, it’s probably best handled separately. However, there is a decent chance that excluding a large number of known irrelevant commits will catch the problematic ones in that scenario - and should match the previous behavior of treating the problem commits as initial.