Open Lillecarl opened 5 years ago
@Lillecarl We looked into using submodules before, but found them too bothersome to use. Cyberium used git subtree command for merging the core and DB (Note: not the same as git subtree merging). You can see which commit was merged in the "Squashed"-commits messages. E.g. the DB was merged at cmangos/classic-db@697685933dedef547eccb7213bbd6e85bc16f2bf.
This is what the history currently looks like:
Probably done like this:
git subtree add -P core https://github.com/cmangos/mangos-classic.git master --squash
git subtree add -P sql https://github.com/cmangos/classic-db.git master --squash
Note: would lead to different result today, as the master branches progressed in the meantime.
For some reason, maybe to avoid uploading all the commits, @cyberium used the --squash
option when merging, so the remote history is not included. I'd personally prefer the repo to include all the source trees properly, which I demonstrated on the noSquash branch of my fork, by resetting the repo to the initial commit and then using git remote
and git subtree add
command without the --squash
option.
git remote add classic-core https://github.com/cmangos/mangos-classic.git
git fetch classic-core
git subtree add -P core 6f8c7040e81f8a1c87b4f98ac061ab5d64e49683
git commit --amend
git remote add classic-db https://github.com/cmangos/classic-db.git
git fetch classic-db
git subtree add -P sql 697685933dedef547eccb7213bbd6e85bc16f2bf
git commit --amend
OT: In the amend
I changed the merge-messages manually to include the cmangos/repo@
part in front of the commit hash on the git-subtree-split
lines, so that GitHub web interface properly links the source repo, but this should be scriptable as well with the -m
switch of git subtree
.
The history then looks like this:
The main advantage of adding the source repos as a remote is that the whole history can be viewed on the release repo, you can clearly see which commit was the parent on the release repo and which was the parent on the source repo. The main disadvantage is that the whole history has to be uploaded/downloaded once (which was ~350 MB only for classic).
I also demonstrated the different update methods. My forks master branch shows squashed updates from Github.
git subtree pull -P core https://github.com/cmangos/mangos-classic.git master --squash
git subtree pull -P sql https://github.com/cmangos/classic-db.git master --squash
My forks update branch shows non-squashed updates from fetched remote. The whole git-subtree-split
line in the commit message has been added manually.
git fetch classic-core
git subtree merge -P core classic-core/master
git fetch classic-db
git subtree merge -P sql classic-db/master
Note @cyberium : I cherry-picked your install script commit into the update
branch in case you want to switch to this method.
@Muehe summarized the situation we choose subtree, if you see something important against please let us know. About history it seem that you prefer to keep it fully so i'll remove the squash option.
I'd recommend using git submodules for getting the src in-tree.
Cheers mate :)