From 3a54e85d2195c5915bcee29cceecdb2451e9a748 Mon Sep 17 00:00:00 2001 From: Kerbiter Date: Thu, 26 Dec 2024 14:52:46 +0200 Subject: [PATCH] Add info on how to submit changes to YRpp --- docs/Contributing.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/Contributing.md b/docs/Contributing.md index a994803569..5dc1be4588 100644 --- a/docs/Contributing.md +++ b/docs/Contributing.md @@ -186,6 +186,21 @@ git config --global branch.autoSetupRebase always git config --global diff.colorMoved zebra ``` +### Working with YRpp via submodules + +Often when working on Phobos and/or researching the YR engine you'll need to implement corrections for YRpp. Generally the corrections need to be submitted to [YRpp repository](https://github.com/Phobos-developers/YRpp) and can be done separately from the actual features in Phobos, but frequently the improvements are to be submitted as a part of Phobos contribution process. To submit improvements to YRpp you have to create a branch in YRpp, then you can push it and submit a pull request to YRpp repository. + +When you clone Phobos recursively - you also clone YRpp as a submodule. Basically submodules are just nested repositories. You can open it like any other repository, so the changes can be synchronized to Phobos and you don't need to rename stuff by hand. + +The suggested workflow is as follows: +1. In your IDE of choice rename fields and functions using symbol renaming feature (`Rename...` feature in Visual Studio (regular or Code), `[F2]` by default), then you will have two "levels" of changes displayed in your Git client: + - for Phobos repository - changes in the Phobos code (as regular changes) and changes to YRpp (as one submodule change) + - for YRpp repository - changes to the field names and function names in YRpp as regular changes. +2. Create a branch in YRpp repository (create a fork of it if you didn't yet), commit and push the changes and submit it as a pull request. After pushing it you have two options in Phobos repository: + - wait until it's accepted, then checkout YRpp at the newest commit, then commit and push - this will save you having to commit and push multiple times, but you won't be able to get a nightly build for people to test; + - don't wait for YRpp changes to be merged, commit and push right after you pushed the YRpp changes to your YRpp branch - you will have an up-to-date build on Phobos pull request this way. Note that you must do this only after you committed to and pushed your YRpp branch, otherwise the build system won't know what are the changes as they are not exposed to the world, only available to you locally. +3. After the YRpp pull request gets accepted you will need to switch to the latest commit that was merged (you do that in the submodule), verify that it compiles like normal, and then commit and push it to your Phobos branch that you made for your pull request. + ## Ways to help Engine modding is a complicated process which is pretty hard to pull off, but there are also easier parts which don't require mastering the art of reverse-engineering or becoming a dank magician in C++.