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

Re: [PATCH v2 0/7] subtree: Fix handling of complex history

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 7, 2020, 19:46 UTC
Message-ID
<nycvar.QRO.7.76.6.2010072143390.50@tvgsbejvaqbjf.bet>
In-Reply-To
<pull.493.v2.git.1602021913.gitgitgadget@gmail.com>
Hi Tom,
On Tue, 6 Oct 2020, Tom Clarkson via GitGitGadget wrote:
Show 25 quoted lines
> Fixes several issues that could occur when running subtree split on large
> repos with more complex history.
>
>  1. A merge commit could bypass the known start point of the subtree, which
>     would cause the entire history to be processed recursively, leading to a
>     stack overflow / segfault after reading a few hundred commits. Older
>     commits are now explicitly recorded as irrelevant so that the recursive
>     process can terminate on any mainline commit rather than only on subtree
>     joins and initial commits.
>
>
>  2. It is possible for a repo to contain subtrees that lack the metadata
>     that is usually present in add/join commit messages (git-svn at least
>     can produce such a structure). The new use/ignore/map commands allow the
>     user to provide that information for any problematic commits.
>
>
>  3. A mainline commit that does not contain the subtree folder could be
>     erroneously identified as a subtree commit, which would add the entire
>     mainline history to the subtree. Commits will now only be used as is if
>     all their parents are already identified as subtree commits. While the
>     new code can still be tripped up by unusual folder structures, the
>     completely unambiguous solution turned out to involve a significant
>     performance penalty, and the new ignore / use commands provide a
>     workaround for that scenario.

I gave this as thorough a review as I can (which is not saying too much, as I am not exactly familiar with `git subtree`'s inner workings).

Hopefully some of my comments and suggestions are helpful.

At some stage, especially given the problems I pointed out with the implementation detail that is a flat directory with a potentially insane number of files in it, I think it would make a lot of sense to go ahead and turn this into a built-in Git command, implemented in C, and with a more robust file system layout of its cache.

Ciao, Dscho

Previous: Johannes Schindelin
Message 28 of 28 in “subtree: Fix handling of complex history”
  1. 0/7 subtree: Fix handling of complex historyTom Clarkson via GitGitGadget, May 11, 2020
  2. 1/7 subtree: handle multiple parents passed to cache_missTom Clarkson via GitGitGadget, May 11, 2020
  3. 2/7 subtree: exclude commits predating add from recursive processingTom Clarkson via GitGitGadget, May 11, 2020
  4. 4/7 subtree: add git subtree map commandTom Clarkson via GitGitGadget, May 11, 2020
  5. 3/7 subtree: persist cache between split runsTom Clarkson via GitGitGadget, May 11, 2020
  6. 5/7 subtree: add git subtree use and ignore commandsTom Clarkson via GitGitGadget, May 11, 2020
  7. 7/7 subtree: document new subtree commandsTom Clarkson via GitGitGadget, May 11, 2020
  8. 6/7 subtree: more robustly distinguish subtree and mainline commitsTom Clarkson via GitGitGadget, May 11, 2020
  9. Ed MasteOct 4, 2020
  10. Johannes SchindelinOct 4, 2020
  11. Junio C HamanoOct 5, 2020
  12. Ed MasteOct 5, 2020
  13. Johannes SchindelinOct 7, 2020
  14. 0/7 subtree: Fix handling of complex historyTom Clarkson via GitGitGadget, Oct 6, 2020
  15. 4/7 subtree: add git subtree map commandTom Clarkson via GitGitGadget, Oct 6, 2020
  16. 1/7 subtree: handle multiple parents passed to cache_missTom Clarkson via GitGitGadget, Oct 6, 2020
  17. Ed MasteOct 7, 2020
  18. 5/7 subtree: add git subtree use and ignore commandsTom Clarkson via GitGitGadget, Oct 6, 2020
  19. Johannes SchindelinOct 7, 2020
  20. 6/7 subtree: more robustly distinguish subtree and mainline commitsTom Clarkson via GitGitGadget, Oct 6, 2020
  21. Johannes SchindelinOct 7, 2020
  22. 3/7 subtree: persist cache between split runsTom Clarkson via GitGitGadget, Oct 6, 2020
  23. Johannes SchindelinOct 7, 2020
  24. 2/7 subtree: exclude commits predating add from recursive processingTom Clarkson via GitGitGadget, Oct 6, 2020
  25. Johannes SchindelinOct 7, 2020
  26. 7/7 subtree: document new subtree commandsTom Clarkson via GitGitGadget, Oct 6, 2020
  27. Johannes SchindelinOct 7, 2020
  28. Johannes SchindelinOct 7, 2020

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.