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

Re: [PATCH v5] subtree: fix split processing with multiple subtrees present

From
Zach FettersMoore <zach.fetters@apollographql.com>
Date
Nov 30, 2023, 21:01 UTC
Message-ID
<CAEWN6q14sd-KmMOgmKWqnKWPNUeW7MN5T=PhrkkN5d0VXQEohA@mail.gmail.com>
In-Reply-To
<CAP8UFD1rd+q-dC_w2VgZ_jC++LDeF6gu5wDcbQzSuhU1ksfBpA@mail.gmail.com>
>> To see this in practice you can use the open source GitHub repo
>> 'apollo-ios-dev' and do the following in order:
>>
>> -Make a changes to a file in 'apollo-ios'A and 'apollo-ios-codegen'
> It looks like there is a spurious A after 'apollo-ios' in the line above.
Thanks for catching that, definitely a typo on my part.
>> directories
>> -Create a commit containing these changes
>> -Do a split on apollo-ios-codegen
>> - git subtree split --prefix=apollo-ios-codegen --squash --rejoin
Show 8 quoted lines
> I might be doing something stupid or wrong, but I get the following:
>
> $ git subtree split --prefix=apollo-ios-codegen --squash --rejoin
> fatal: could not rev-parse split hash
> cc70a7d49e84696f0df210710445784c504ed748 from commit
> 360f068ea0d57f250621ab7dbe205313f52a0e98
> hint: hash might be a tag, try fetching it from the subtree repository:
> hint: git fetch <subtree-repository> cc70a7d49e84696f0df210710445784c504ed748

Updated this to include doing a fetch to ensure all remote repo info is available locally.

>> -Do a split on apollo-ios
>> - git subtree split --prefix=apollo-ios --squash --rejoin
Show 11 quoted lines
> Same issue:
>
> $ git subtree split --prefix=apollo-ios --squash --rejoin
> fatal: could not rev-parse split hash
> b852c0aa1fd5ab9e1323da92b606ad3f2211e111 from commit
> b48030c3eb6e2faf4bff981c5c63ca72aceecdfa
> hint: hash might be a tag, try fetching it from the subtree repository:
> hint: git fetch <subtree-repository> b852c0aa1fd5ab9e1323da92b606ad3f2211e111
>
> I didn't try to get farther than this, as it seems that some
> instructions might be missing.
Same as above, added extra instruction to do a fetch first.

Also added a little extra info that the issue may present after the first split in the instructions depending on the current state of the repo being used. Also added a way to do the same steps with the changes applied to see that it resolves the issue.

Show 9 quoted lines
>> So this commit makes a change to the processing of commits for the
>> split command in order to ignore non-mainline commits from other
>> subtrees such as apollo-ios in the above breakdown by adding a new
>> function 'should_ignore_subtree_commit' which is called during
>> 'process_split_commit'. This allows the split/rejoin processing to
>> still function as expected but removes all of the unnecessary
>> processing that takes place currently which greatly inflates the
>> processing time. In the above example, previously the final split
>> would take ~10-12 minutes, while after this fix it takes seconds.
> Nice!
>
> Except for the above issues in the commit message, the rest of the
> patch looks good to me, thanks!
Great! Thanks for the review and guidance!
Previous: Christian CouderNext: Zach FettersMoore via GitGitGadget
Message 17 of 30 in “subtree: fix split processing with multiple subtrees present”
  1. subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Sep 18, 2023
  2. Junio C HamanoSep 18, 2023
  3. Junio C HamanoSep 19, 2023
  4. Zach FettersMooreOct 26, 2023
  5. 0/2 subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Sep 22, 2023
  6. 2/2 subtree: changing location of commit ignore processingZach FettersMoore via GitGitGadget, Sep 22, 2023
  7. 1/2 subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Sep 22, 2023
  8. 0/3 subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Sep 29, 2023
  9. 2/3 subtree: changing location of commit ignore processingZach FettersMoore via GitGitGadget, Sep 29, 2023
  10. 3/3 subtree: adding test to validate fixZach FettersMoore via GitGitGadget, Sep 29, 2023
  11. 1/3 subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Sep 29, 2023
  12. subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Oct 26, 2023
  13. Christian CouderNov 18, 2023
  14. Zach FettersMooreNov 28, 2023
  15. subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Nov 28, 2023
  16. Christian CouderNov 30, 2023
  17. Zach FettersMooreNov 30, 2023
  18. subtree: fix split processing with multiple subtrees presentZach FettersMoore via GitGitGadget, Dec 1, 2023
  19. Christian CouderDec 4, 2023
  20. Zach FettersMooreDec 11, 2023
  21. Christian CouderDec 12, 2023
  22. Junio C HamanoDec 12, 2023
  23. Zach FettersMooreDec 13, 2023
  24. Christian CouderJan 3, 2024
  25. Christian CouderDec 20, 2023
  26. Christian CouderJan 25, 2024
  27. Junio C HamanoJan 25, 2024
  28. Christian CouderJan 25, 2024
  29. Junio C HamanoJan 25, 2024
  30. subtree: [v2.44 regression] split may produce different historyColin Stagner, Aug 21, 2025

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.