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!