Re: [PATCH v6] subtree: fix split processing with multiple subtrees present
- From
Christian Couder <christian.couder@gmail.com>
- Date
- Dec 20, 2023, 15:25 UTC
- Message-ID
- <CAP8UFD3b2y+55j3NMDm89hpVRNxX2TA-AdQS=zsboD30pZ1c4Q@mail.gmail.com>
- In-Reply-To
- <CAP8UFD19phFz54d8fDM=MBRMSD9Rz4R0_463KgptN8eeFs7MnQ@mail.gmail.com>
On Tue, Dec 12, 2023 at 5:06 PM Christian Couder <christian.couder@gmail.com> wrote:
Show 46 quoted lines
> > On Mon, Dec 11, 2023 at 4:39 PM Zach FettersMoore > <zach.fetters@apollographql.com> wrote: > > > > >> > > >> From: Zach FettersMoore <zach.fetters@apollographql.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' and 'apollo-ios-codegen' > > >> directories > > >> -Create a commit containing these changes > > >> -Do a split on apollo-ios-codegen > > >> - Do a fetch on the subtree repo > > >> - git fetch git@github.com:apollographql/apollo-ios-codegen.git > > >> - git subtree split --prefix=apollo-ios-codegen --squash --rejoin > > > > > Now I get the following without your patch at this step: > > > > > > $ git subtree split --prefix=apollo-ios-codegen --squash --rejoin > > > [...]/libexec/git-core/git-subtree: 318: Maximum function recursion > > > depth (1000) reached > > > > > > Line 318 in git-subtree.sh contains the following: > > > > > > missed=$(cache_miss "$@") || exit $? > > > > > > With your patch it seems to work: > > > > > > $ git subtree split --prefix=apollo-ios-codegen --squash --rejoin > > > Merge made by the 'ort' strategy. > > > e274aed3ba6d0659fb4cc014587cf31c1e8df7f4 > > > > Looking into this some it looks like it could be a bash config > > difference? My machine always runs it all the way through vs > > failing for recursion depth. Although that would also be an issue > > which is solved by this fix. > > I use Ubuntu where /bin/sh is dash so my current guess is that dash > might have a smaller recursion limit than bash. > > I just found https://stackoverflow.com/questions/69493528/git-subtree-maximum-function-recursion-depth > which seems to agree. > > I will try to test using bash soon.
Sorry, to not have tried earlier before with bash.
Now I have tried it and yeah it works fine with you patch, while without it the last step of the reproduction recipe takes a lot of time and results in a core dump:
/home/christian/libexec/git-core/git-subtree: line 924: 857920 Done
eval "$grl"
857921 Segmentation fault (core dumped) | while read rev parents; do
process_split_commit "$rev" "$parents";
doneSo overall I think your patch is great! Thanks!