It seems that I was absent from my question, and the discussion of possible solutions was a correct understanding of graph theory. Ideas like โiterating all the way from the old revision to the new editionโ were not really clearly defined, or at least not reflecting what I expected from them. Coming to this from a more rigorous point of view, I think I have an approach that works.
To begin with, the problem is: Subrepo revisions represent only the state of their own subtrees at a given point in history. I want to match them with revisions that represent the state of the entire merged tree. Then the DAG sub-mode can be combined with the top-level DAG in a meaningful way.
For this sub-pre-version of R, we may ask what changes of the top-level repo (or parent-repo, if we have several levels of sub-repo), include R or any descendant of R. Assuming a single root, this set of revisions has the lowest common ancestor (or maybe more than one) that seems like a good candidate. Indeed, if the top-level version S that we use with R is not a common ancestor of the revisions that R or its descendants use (but matching is otherwise reasonable), then R will have a descendant R ', the related top-level revision S 'is not a descendant of S. In other words, a story derived from sub-scanty will have confusing / meaningless jumps between revisions of a top-level tree.
Now, if we want to choose a common ancestor, the lowest one makes sense in terms of making these changes something that can be verified, built and verified, and in terms of providing a reasonable idea that the state of the top-level repo (and other sub provisions) It was at a time when changes were made in support. Of course, the root of the entire top-level DAG will also work, but it will not produce meaningful, usable changes that could be verified; choosing a root will be equivalent (in terms of ease of use) to a naive repo merge, having one root in each subreport and simply merging with the history of subrepoly whenever the top-level repo updates the versions it uses.
So, if we can use LCA to assign a top-level version T (R) to each sub-R version of R, how does this translate to
Whenever a revision of subrepo R has a T (R) different from T (P) for each parent P of R, it effectively combines the new changes from the top-level repo (and other subsequences) into the story sub-sequentially. The transformation should represent this as two commits:
The actual subrepo fixes R using the old top-level revision. If R has one parent P (and not a merge union), it will be T (P). If R had several parents, it is unclear if there is an ideal choice to use, but T (P) for any parent P should be reasonable.
A merge negotiation that combines the inverse transform C (T (R)) of the top-level repo compilation T (R) associated with R, where C (T (R)) simply merges (1) above.
In addition to C (T (R)), which refers to (1) as the merge parent, all other references to R in the transformation must use (2). This includes transformations of any descendants of T (R) into top-level repos that use revision R of this sub-class, and transformations of direct children of R.
I believe that the above (albeit poorly worded) description indicates everything that is needed to merge the top-level DAG and subrepo. Each revision of subrepo receives the full version of the tree and ends up connecting to a single DAG for the converted repo through "command commits" (when subrepo merges the new linked version of the top level and when the top level merges the changes that have changed).
Finally, the last step in creating a git repo is simply to rename the combined DAG, either in a topologically sorted form, or through the first walk with depth, so that every git commit-tree already has all the necessary parental changes present.