Description
The current situation where the project is spread over multiple repositories doesn't serve any real purpose and complicates development, additionally it is never really clear where an issue should be posted.
We should cleanup the layout of the project and merge the repositories under lib/
into copilot
. copilot-discussion
shouldn't be part of this as it does not contain any code.
Taking on this change is a big step, that has to executed perfectly to be consistent with the history of the project:
- Move milestones, issues, pull requests and issue labels over to
copilot
. Milestones sharing their name should be merged. Issues and pull requests will get new unique identifiers (as there will obviously be overlap, i.e. multiple issues with the same number). - Per merged repository, we need to keep track of the mapping between old issue numbers and new ones: We need to update the references in commit messages to these new issue numbers.
- Per repository, we need to update the issue numbers in changelogs as well.
- We need to merge the code of the repository into the
lib/
subdirectory of thecopilot
repository:- Remove the repository from the submodules (exact method still pending):
$ git submodule deinit lib/<repo>
$ git rm lib/<repo>
$ git commit -m 'Removed <repo> directory. Refs #88.'
- In the
copilot
directory, add a and fetch new remote:
$ git remote add -f <repo> git@github.com:Copilot-Language/<repo>.git
- Create a local branch for the remote:
$ git branch -t <repo>-master <repo>/master
- Checkout the new branch:
$ git checkout <repo>-master
- Create the
lib/<repo>
directory in the new branch:
$ mkdir -p .lib/<repo>
- Move all files to .lib/ (pay attention to dot-files):
$ git mv <allfiles> .lib/<repo>
- Move
.lib
tolib
:
$ git mv .lib lib
- Commit the move:
$ git commit -m 'Moved files to <repo> subdirectory. Refs #88.'
- Rewrite all commit messages of this repository based on the new issue/PR numbers:
$ git filter-branch -f --msg-filter "sed -f $PWD/../../issuemaps/<repo>.issues" --tag-name-filter cat -- <firstcommit>..HEAD
$ git filter-branch -f --msg-filter "sed -f $PWD/../../issuemaps/<repo>.pulls" --tag-name-filter cat -- <firstcommit>..HEAD
- Update changelog and commit changes:
$ sed -i -f $PWD/../../issuemaps/<repo>.issues Changelog
$ sed -i -f $PWD/../../issuemaps/<repo>.pulls Changelog
- Update any reference to the old repository url (for example in the .cabal file).
- Return to the master of
copilot
:
$ git checkout master
- Merge the repository into
copilot
:
$ git merge <repo>-master --no-ff --allow-unrelated-histories
- Remove the temporary branch:
$ git branch -D <repo>-master
- Remove and commit
.gitignore
and.travis.yml
.
- Remove the repository from the submodules (exact method still pending):
Note that with this method, the resulting directory structure will not change. All history, commit messages, issues, milestones etc. should all be transferred over the central copilot
repository.
Afterwards we can opt to hide or remove the now obsolete repositories.