Port script: apply a change from one version to the others #17

Closed
opened 2026-09-26 00:39:25 +00:00 by selimaj-dev · 0 comments
Owner

Problem

Each Minecraft version has its own copy of the version-specific code (versions/<mc>/src). A fix made in one version has to be repeated by hand in up to seven others, even though most files are identical or nearly identical between versions (21 of 52 files are byte-identical across all 8). Forgetting a version, or mis-copying a change, is easy.

Proposal

A script, scripts/port.sh, that takes a change made in one version and applies it to the others with git apply --3way:

  • Source: by default, the uncommitted changes under versions/<from>/src. Optionally, a commit.
  • Target: every other version, or a chosen list.
  • Clean application where the files match. Where a version really differs, normal merge conflicts appear in that file only.
  • Report: per version, one of "applied", "conflicts in …", "already applied" or "failed". Non-zero exit if any version needs attention.
  • Scope: only src/ is ported. build.gradle and gradle.properties are version-specific on purpose.

Related: #8 (closed in favour of keeping separate version modules, with this tooling).

## Problem Each Minecraft version has its own copy of the version-specific code (`versions/<mc>/src`). A fix made in one version has to be repeated by hand in up to seven others, even though most files are identical or nearly identical between versions (21 of 52 files are byte-identical across all 8). Forgetting a version, or mis-copying a change, is easy. ## Proposal A script, `scripts/port.sh`, that takes a change made in one version and applies it to the others with `git apply --3way`: - **Source:** by default, the uncommitted changes under `versions/<from>/src`. Optionally, a commit. - **Target:** every other version, or a chosen list. - **Clean application** where the files match. Where a version really differs, **normal merge conflicts appear in that file only**. - **Report:** per version, one of "applied", "conflicts in …", "already applied" or "failed". Non-zero exit if any version needs attention. - **Scope:** only `src/` is ported. `build.gradle` and `gradle.properties` are version-specific on purpose. Related: #8 (closed in favour of keeping separate version modules, with this tooling).
Sign in to join this conversation.