Ports a change made under one version's versions/<mc>/src to the other versions:
Source: uncommitted changes, auto-detected when exactly one version has them, or a commit with --commit <rev>. New untracked files are included by marking them git add -N.
Diff: taken with --full-index. For each target version, only the file headers are rewritten to point at that version's folder.
Already applied: targets where the patch applies in reverse are skipped ("already has this change"), so re-running is safe.
Merge: the rest is applied with git apply --3way. It's clean where files match, and gives normal conflict markers only where a version's code really differs (ours = the version's code, theirs = the ported change).
Report: each version is listed as applied / CONFLICTS (with files) / already has this change / FAILED, and the script exits 1 if anything needs attention.
Options: --from, --to v1,v2, --commit, --dry-run. Only src/ is ported; build.gradle and gradle.properties are version-specific on purpose. It's compatible with macOS's bash 3.2.
Runs ./gradlew compileJava --continue for every version on pull requests and on pushes to master, with the common submodule. It catches missed or bad ports, including code that ported cleanly as text but uses an API a version doesn't have. --continue reports every failing version in one run.
VERSION_GUIDE.md
The one-line stub now documents the layout, porting a change (script usage and outcomes), and adding a new Minecraft version.
Testing
The port script was tested in a throwaway clone:
An edit to a region of TabListMixin shared by all versions applied cleanly to all 7 other versions.
An edit to the version-specific line (profile.name()) applied to 1.21.9 and 1.21.10, and conflicted on 1.21.4–1.21.8 with the correct ours/theirs markers. Exit code 1.
A new file was created in every version.
A re-run gave "already has this change" everywhere.
--dry-run, --commit HEAD --to 1.21.4,1.21.9, an unknown version, and nothing to port all behaved as intended.
Closes #17 and #18. Follows up #8, which kept separate version modules and made porting cheaper with tooling instead.
## Summary
### `scripts/port.sh` (#17)
Ports a change made under one version's `versions/<mc>/src` to the other versions:
1. **Source:** uncommitted changes, auto-detected when exactly one version has them, or a commit with `--commit <rev>`. New untracked files are included by marking them `git add -N`.
2. **Diff:** taken with `--full-index`. For each target version, only the file headers are rewritten to point at that version's folder.
3. **Already applied:** targets where the patch applies in reverse are skipped ("already has this change"), so re-running is safe.
4. **Merge:** the rest is applied with `git apply --3way`. It's clean where files match, and gives normal conflict markers only where a version's code really differs (`ours` = the version's code, `theirs` = the ported change).
5. **Report:** each version is listed as applied / CONFLICTS (with files) / already has this change / FAILED, and the script exits 1 if anything needs attention.
Options: `--from`, `--to v1,v2`, `--commit`, `--dry-run`. Only `src/` is ported; `build.gradle` and `gradle.properties` are version-specific on purpose. It's compatible with macOS's bash 3.2.
### `.gitea/workflows/check.yml` (#18)
Runs `./gradlew compileJava --continue` for every version on pull requests and on pushes to `master`, with the `common` submodule. It catches missed or bad ports, including code that ported cleanly as text but uses an API a version doesn't have. `--continue` reports every failing version in one run.
### `VERSION_GUIDE.md`
The one-line stub now documents the layout, porting a change (script usage and outcomes), and adding a new Minecraft version.
## Testing
The port script was tested in a throwaway clone:
- An edit to a region of `TabListMixin` shared by all versions **applied cleanly to all 7** other versions.
- An edit to the version-specific line (`profile.name()`) **applied to 1.21.9 and 1.21.10, and conflicted on 1.21.4–1.21.8** with the correct `ours`/`theirs` markers. Exit code 1.
- A new file was created in every version.
- A re-run gave "already has this change" everywhere.
- `--dry-run`, `--commit HEAD --to 1.21.4,1.21.9`, an unknown version, and nothing to port all behaved as intended.
**The check workflow's first run is this PR.**
🤖 Generated with [Claude Code](https://claude.com/claude-code)
- scripts/port.sh ports a change made under versions/<from>/src to the
other versions with `git apply --3way`: clean where files match,
normal conflicts only where a version really differs. Supports
uncommitted changes or --commit, --to, --dry-run, and detects changes
already applied.
- .gitea/workflows/check.yml compiles every version on pull requests and
pushes to master (--continue reports all failing versions).
- VERSION_GUIDE.md documents the layout, porting, and adding a version.
Closes#17, closes#18
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Closes #17 and #18. Follows up #8, which kept separate version modules and made porting cheaper with tooling instead.
Summary
scripts/port.sh(#17)Ports a change made under one version's
versions/<mc>/srcto the other versions:--commit <rev>. New untracked files are included by marking themgit add -N.--full-index. For each target version, only the file headers are rewritten to point at that version's folder.git apply --3way. It's clean where files match, and gives normal conflict markers only where a version's code really differs (ours= the version's code,theirs= the ported change).Options:
--from,--to v1,v2,--commit,--dry-run. Onlysrc/is ported;build.gradleandgradle.propertiesare version-specific on purpose. It's compatible with macOS's bash 3.2..gitea/workflows/check.yml(#18)Runs
./gradlew compileJava --continuefor every version on pull requests and on pushes tomaster, with thecommonsubmodule. It catches missed or bad ports, including code that ported cleanly as text but uses an API a version doesn't have.--continuereports every failing version in one run.VERSION_GUIDE.mdThe one-line stub now documents the layout, porting a change (script usage and outcomes), and adding a new Minecraft version.
Testing
The port script was tested in a throwaway clone:
TabListMixinshared by all versions applied cleanly to all 7 other versions.profile.name()) applied to 1.21.9 and 1.21.10, and conflicted on 1.21.4–1.21.8 with the correctours/theirsmarkers. Exit code 1.--dry-run,--commit HEAD --to 1.21.4,1.21.9, an unknown version, and nothing to port all behaved as intended.The check workflow's first run is this PR.
🤖 Generated with Claude Code