How to merge (spigot) forks in git.

Discussion in 'Spigot Plugin Development' started by sirati97, Jun 3, 2016.

  1. Hi everyone,
    At the beginning of this year i created a high performance spigot fork that allows you to add custom items and create highly responsive guis and custom inventories. It allows deep modding into nms without getting incompatible with any normal bukkit plugin or the vanilla game client.I will publish this fork as soon as i added all the important features. (everything from above already works).

    But for now i want to update from 1.8 to 1.9. But i have two problems: First i never merged two branches with git in intellij before and i do not know how to combine the spigot 1.9.2 branch with the my fork of spigot 1.8.8.

    SO my question is: is here someone who wants to explain me this process in details so that i can do it my self in the future. And if someone from the spigot team reads this: are there any tricks as spigot doesnt have a normal git repository as it uses the buildtool and how can i deploy my fork via the build tool? This is not a question about developing. Only about git, spigot and intellij. I would be pleased if someone would help me.

    mfg sirati97
     
  2. MiniDigger

    Supporter

    lemme explain how the spigot development process works:
    • getting the workspace setup (buildtools does that):
      • downloading and decompiling the minecraft server jar
      • downloading the git projects (spigot-server, spigot, bukkit, craftbukkit)
      • applying the patches (from craftbukkit and spigot-server) (there is a applyPatches.sh)
    • doing changes to nms stuff (obc and bukkit stuff is easier, you can just modify the code and commit it)
      • do the changes to the nms classes like normal
      • rebuild the patches to include your modification (there is a rebuildPatches.sh)
      • only commit the patches, not the modified nms source files
    using this process its save to distribute spigot using the buildtools because buildtools just downloads the projects (which do not contain proprietary code) and apply the patches that the projects include to the downloaded and decompiled nms server jar.

    for your project I would recommend you doing the same. I don't know if buildtools support building forks, but you always just can fork buildtools too and change the repo url.

    for updating to a newer version I am not sure how the spigot team handles that. My guess would be that they just download and decompile the newest minecraft server, apply the patches and fix the source files till the server runs again. then they can rebuild the patches.
    but again, not sure about that, maybe someone can confirm that.

     
  3. Yes i did it exactly in this way. The question with the build tool is only for the spigot team as they are the only one how know if there is any easier way than they way i came up with (and you explained here)

    The problem is that i cannot simply combine them as they are different git repos. Therefore with i would need to import the new git repo of the newer spigot version as a branch into my old git repo and then merge them. (i hope that the merge process is supported by intellij as it will be less of a pain in intellij) and i dont know how to import a different git repo as a branch.
     
  4. MiniDigger

    Supporter

    well merging of source files should be fine. I don't know about merging patch files tho...
    try asking in #spigot-dev on the spigot irc and stick around for a while, someone will answer that for you.
     
  5. Serializator

    Supporter

    You don't necessarily have to merge patch files, you could merge the outcome of the patch files from 1.9 with the fork of 1.8 you have and build a patch from that?
     
    • Friendly Friendly x 1
  6. MiniDigger

    Supporter

    oh yeah, that could work. get 1.9 jar, apply spigot 1.9 patches, apply your patches, fix the source files, rebuild patches.
    try that @sirati97
     
  7. I will try that as soon as i finish my more recent project. Now i still have the question of deployment. maybe also over the Spigot Developer Hub
     
  8. MiniDigger

    Supporter

    I suggested I would recommend just forking buildtools and change the repo urls https://hub.spigotmc.org/stash/proj...in/java/org/spigotmc/builder/Builder.java#178
    you could use the spigot stash to host your project but I guess github would be better.
    then you just need to distribute the buildtools jar and it will work like it works for spigot