diff --git a/.opencode/skills/cctest-recipe-upstream/SKILL.md b/.opencode/skills/cctest-recipe-upstream/SKILL.md index 52bac6f..1db8420 100644 --- a/.opencode/skills/cctest-recipe-upstream/SKILL.md +++ b/.opencode/skills/cctest-recipe-upstream/SKILL.md @@ -80,4 +80,11 @@ one upgrade commit. Guard: while preparing, run `git merge-base `; if the result is older than a few commits below upstream `origin/main`, cherry-pick the upgrade commit(s) onto fresh upstream `origin/main` (branch `-rebased`), push THAT to the autonomic mirror, and emit the fetch/push/compare commands -using the rebased branch instead of the raw one. +using the rebased branch instead of the raw one. Also fix the stale `origin/main` wording above: +the upstream base branch may be `master`, not `main` — derive it from the remotes. + +**Branch-name mismatch mirror vs upstream.** The mirror and upstream can use different base-branch +names (gitea: mirror `main`, upstream `master`). When emitting step 3 (the post-merge release), +NEVER hardcode `main` — derive the upstream default branch from the existing remotes (`git +remote show origin` or `git ls-remote --symref origin HEAD`) and emit `git checkout ; +git fetch origin; git merge --ff-only origin/;` before `abra recipe release`. diff --git a/scripts/gen-cctest-skills.py b/scripts/gen-cctest-skills.py index 8ea4d21..7d1d9e0 100644 --- a/scripts/gen-cctest-skills.py +++ b/scripts/gen-cctest-skills.py @@ -108,7 +108,14 @@ one upgrade commit. Guard: while preparing, run `git merge-base `; if the result is older than a few commits below upstream `origin/main`, cherry-pick the upgrade commit(s) onto fresh upstream `origin/main` (branch `-rebased`), push THAT to the autonomic mirror, and emit the fetch/push/compare commands -using the rebased branch instead of the raw one. +using the rebased branch instead of the raw one. Also fix the stale `origin/main` wording above: +the upstream base branch may be `master`, not `main` — derive it from the remotes. + +**Branch-name mismatch mirror vs upstream.** The mirror and upstream can use different base-branch +names (gitea: mirror `main`, upstream `master`). When emitting step 3 (the post-merge release), +NEVER hardcode `main` — derive the upstream default branch from the existing remotes (`git +remote show origin` or `git ls-remote --symref origin HEAD`) and emit `git checkout ; +git fetch origin; git merge --ff-only origin/;` before `abra recipe release`. """, }