lite icon indicating copy to clipboard operation
lite copied to clipboard

Recover pre-merged histories from repositories "git subtree add" has …

Open dxops opened this issue 9 years ago • 9 comments

…added to the monorepo.

Hope to see this feature in master

dxops avatar Dec 29 '16 15:12 dxops

This would close #15 and #23, right?

fabpot avatar Jan 03 '17 02:01 fabpot

@fabpot Looks so

mhumeSF avatar Feb 08 '17 01:02 mhumeSF

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.

mmunro-ltrr avatar Feb 08 '17 01:02 mmunro-ltrr

Is there anything I can do, to get this merged? Currently I can not use this awesome tool, as this feature is missing :(

Spea avatar Apr 27 '17 13:04 Spea

@Spea make sure it works as expected - no missing commits, history is ok

dxops avatar Apr 27 '17 13:04 dxops

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

Spea avatar Apr 28 '17 12:04 Spea

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.

dxops avatar Apr 28 '17 14:04 dxops

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/

mmunro-ltrr avatar Apr 28 '17 21:04 mmunro-ltrr

Looks like git subtree has the same issue with merge commits https://github.com/git/git/commit/dd65a9e5e3b6298e4fa52e21680008e7fd5556ea#diff-59f70cbe935ec223e3df413b94cab740

dxops avatar Feb 28 '18 13:02 dxops