diff --git a/AGENTS.md b/AGENTS.md index fb95118a1..40ea457bd 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -10,6 +10,20 @@ git config core.hooksPath .githooks CI runs `Tools/ForDevelopers/scripts_json.py check` on every pull request; its docstring and its failure message give the repair command. +## Pull requests + +PRs target `noelrohi/Scripts` (base `Skua`); auqw/Scripts is upstream and gets none. After opening one, check the URL names `noelrohi/Scripts`. + +## Upstream sync + +Merging `upstream/Skua` (auqw/Scripts) into `Skua`: + +1. On a `sync/upstream-` branch, `git merge --no-ff upstream/Skua`. +2. Where the fork deliberately changed or deleted a Script, keep the fork's side and fold in upstream's new fixes. +3. Resolve `scripts.json` by regenerating it: `git checkout --ours scripts.json && git add scripts.json && python3 Tools/ForDevelopers/scripts_json.py sync --all`. +4. Before pushing: `scripts_json.py check` passes, and `skua scripts check ` passes for every `.cs` the merge changes. +5. Title the PR `Merge upstream auqw/Scripts Skua ( commits)` and merge it with a merge commit, so the next sync finds the right merge base. #40 and #42 show the body. + ## Testing a branch on a Skua Engine Push the branch, then point the Engine's Script Source at it and sync: diff --git a/Tools/ForDevelopers/scripts_json.py b/Tools/ForDevelopers/scripts_json.py index fba26f4d7..228d2bccd 100755 --- a/Tools/ForDevelopers/scripts_json.py +++ b/Tools/ForDevelopers/scripts_json.py @@ -113,6 +113,9 @@ def dump(entries): def staged_entries(): + if git("ls-files", "--unmerged", "--", SCRIPTS_JSON): + sys.exit(f"{SCRIPTS_JSON} is unmerged. Pick a side and stage it, then sync again:\n" + f" git checkout --ours {SCRIPTS_JSON} && git add {SCRIPTS_JSON}") return json.loads(git("show", ":" + SCRIPTS_JSON))