From: D. Ben Knoble Date: Mon, 16 Feb 2026 21:33:35 GMT Subject: Re: [PATCH 3/3] contrib/subtree: process out-of-prefix subtrees Message-ID: In-Reply-To: <20260215201906.889951-4-ask+git@howdoi.land> On Mon, Feb 16, 2026 at 4:16 PM Colin Stagner wrote: > > `should_ignore_subtree_split_commit` detects subtrees which are > outside of the current path --prefix and ignores them. This can > speed up splits of repositories that have many subtrees. > > Since its inception [1], every iteration of this logic [2], [3] > incorrectly excludes commits. This alters the split history. The > split history and its commit hashes are API contract, so this is > not permissible. > > While a commit from a different subtree may look like it doesn't > contribute anything to a split, sometimes it does. Merge commits > are a particular hot spot. For these, the pruning logic in > `copy_or_skip` performs: > > 1. a check for "treesame" parents > 2. two different common ancestry checks > > These checks operate on the **split history**, not the input > history. The split history omits commits that do not affect the > --prefix. This can significantly alter the ancestry of a merge. > In order to determine if `copy_or_skip` will skip a merge, it > is likely necessary to compute all the split history... which > is what `should_ignore_subtree_split_commit` tries to avoid. > > To make this logic API-preserving, we could gate it behind a > new CLI argument. The present implementation is actually a > speed penalty in many cases, however, so this is not done here. > > Remove the `should_ignore_subtree_split_commit` logic. This > fixes the regression reported in [4]. > > [1]: 98ba49ccc2 (subtree: fix split processing with multiple subtrees present, 2023-12-01) > > [2]: 83f9dad7d6 (contrib/subtree: fix split with squashed subtrees, 2025-09-09) > > [3]: 28a7e27cff (contrib/subtree: detect rewritten subtree commits, 2026-01-09) > > [4]: <20251230170719.845029-1-george@mail.dietrich.pub> > > Reported-by: George > > Reported-by: Christian Heusel > > Signed-off-by: Colin Stagner nit: "git interpret-trailers --parse" doesn't understand line-separated trailers, so only finds the SoB line. See git-interpret-trailers(1). (A useful test locally was something like b4 am https://lore.kernel.org/git/20260215201906.889951-4-ask+git@howdoi.land/ git mailsplit -op 20260215_ask_git_contrib_subtree_process_out_of_prefix_subtrees.mbx git interpret-trailers --parse p/0003 which output only Signed-off-by: Colin Stagner which I don't think you intended.) -- D. Ben Knoble