Recover pre-merged histories from repositories "git subtree add" has …
…added to the monorepo.
Hope to see this feature in master
This would close #15 and #23, right?
@fabpot Looks so
I've been asleep through the course of the pull request, dreaming that someone had come up with a replacement for our workaround, & just noticed that the code was from https://github.com/ltrr-arizona-edu/lite/tree/UADIGITAL-739 & not from anywhere else! I don't know of any problems, but perhaps should scramble around to provide some test coverage at least.
Is there anything I can do, to get this merged? Currently I can not use this awesome tool, as this feature is missing :(
@Spea make sure it works as expected - no missing commits, history is ok
Tested it with one of our SDKs and compared it with a normal subtree split
Here are my results:
Original single repository
Number of commits: 2304 Last 3 commit hashes:
- a6efa2d0
- c03875cf
- a5993fc7
Subtree split in mono repository
Command: git subtree split --prefix sdk
Number of commits: 2304
Last 3 commit hashes:
- a6efa2d0
- c03875cf
- a5993fc7
Splitsh/lite in monorepository
Command: go run main.go --path=../mono --prefix=sdk --debug --scratch --progress
Number of commits: 1804
Last 3 commit hashes:
- 5a8972a40
- 189d36b44
- a082fb70f
Conclusion
As you can see, the number of commits + hashes differ from the git subtree split command and the original single repo. After taking a closer look at the commits, it looks like all of the "Merge pull request" commits (from github) are gone when using splitsh-lite.
Now the big question: Is this expected behaviour? I thought it would produce the same result as a git subtree split
Different hashes are expected, the most case is that you hashes were created using different git version but splitsh uses only one strategy (latest git by default). I think you should run tests and compare files to make sure everything is ok.
I had worries about the hashes differing, but the ultimate reference for a monorepo to manyrepo split must be Symfony, and there you can also see differences. I've not yet delivered on the promised updates to the tests (to cover the changes in this pull request), but we're starting to use a Dockerized version with the changes applied already, if anyone is interested: https://hub.docker.com/r/uadrupal/schismatic/
Looks like git subtree has the same issue with merge commits https://github.com/git/git/commit/dd65a9e5e3b6298e4fa52e21680008e7fd5556ea#diff-59f70cbe935ec223e3df413b94cab740