-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merge phpunit-mock-objects into this repository #3103
Comments
It is indeed possible to merge multiple repositories in git. It's a little-known fact that git repositories can have multiple "initial commits". I've followed https://stackoverflow.com/a/20974621/766120 with great success (notice that the answer is not the accepted one), because it keeps the history. However, I have noticed that later searching for specific keywords from the history does not work very well (https://stackoverflow.com/a/2929502/766120). I guess the search only goes down one branch and fails to look through all of the other commits that were included from the other branch. |
Here is a snippet we used to merge 3 subrepo in one. https://gist.github.com/mRoca/12e2b649158010ebd24a8fcea0f36000 |
I'm not a git expert, but I would try the following:
|
I did this last week to merge 5 python repos
|
I experienced a different situation where the project started as being hosted on Subversion and, at some point, the current version of the code was imported into Git as a new project. The development continued using the Git repo but several months and several hundred commits later I started missing the project history that was not imported from the Subversion repository. After I converted the Subversion repo to a new Git repo I joined the two Git repos while keeping the commit dates and documented the entire process in this post: http://axiac.ro/blog/merging-git-repositories/ |
Trying what @nealio82 suggested:
When I do
When I skip this step and jump ahead to the final merge operation then I get:
These conflicts are due to the fact that the (contents of the)
|
Hello Sebastian, I wrote a script that rebases the history line of Commit Th script copies all commits, including branches and their merges, then carefully restores their original author and commit information. It doesn't copy the branches that were not merged and the tags. The result of running the script is commit On top of what the script produced I created three new commits:
Please add The last three commits (and their explanations above) are also the answer to your question. "Transplanting" the history of |
Thank you so much, @axiac, for your work on this! |
Caused by sebastianbergmann/phpunit#3103, fixes #48.
The motivation to split https://github.com/sebastianbergmann/phpunit-mock-objects from PHPUnit itself and move it to its own repository was to allow for a refactoring of the stub/mock code so that it could be used by other test frameworks. In all these years since the split this never happened. It is is safe to assume that it will not happen.
With that being the case, there is no advantage in having a separate repository/component that holds the test double library for PHPUnit. Therefore phpunit-mock-objects should be "merged back" into the PHPUnit repository. I would like to do so without losing the history that is in the https://github.com/sebastianbergmann/phpunit-mock-objects Git repository.
I do not know whether this is possible (bring phpunit-mock-objects back into PHPUnit's repository without losing history) and if it is then I do not know how. This would be an excellent opportunity for a Git expert to contribute to PHPUnit.
What I need is a series of Git commands that adds the contents of https://github.com/sebastianbergmann/phpunit-mock-objects (only
master
, no branches, no tags) into a top-leveltmp
directory in the https://github.com/sebastianbergmann/phpunit repository. I willgit mv
the files from saidtmp
directory to their correct target directories.The text was updated successfully, but these errors were encountered: