Skip to content

unify: Move various identical files to Core#2858

Open
stephanmeesters wants to merge 1 commit into
TheSuperHackers:mainfrom
stephanmeesters:unify/megamove
Open

unify: Move various identical files to Core#2858
stephanmeesters wants to merge 1 commit into
TheSuperHackers:mainfrom
stephanmeesters:unify/megamove

Conversation

@stephanmeesters

@stephanmeesters stephanmeesters commented Jul 6, 2026

Copy link
Copy Markdown

Moves 232 identical files (header only changes) to Core. Checked that these are .cpp/.h pairs.

For review I used this PowerShell one-liner to check the diff of all files:

$hash_check='390e5d8319aa1bb0e05ac39432ff63a8a6c5b862';$hash_ref='c5e3a9e4012818b0c64591cc689bb38b79f23ba9';$c=git
rev-parse $hash_check;$r=git rev-parse $hash_ref;$p="$c^";git diff --name-only --diff-filter=D "$c^..$c" -- GeneralsMD/Code/|%{$g=$_-replace'^GeneralsMD/Code/','Generals/Code/';git cat-file -e "${r}:$g" 2>$null;if($LASTEXITCODE -eq 0){git diff --no-color "${p}:$_" "${r}:$g"}else{"MISSING: $g at $hash_ref"}}|Out-File megadiff.txt

This looks at all deleted files in current PR (which are from Generals), rewrites those paths to GeneralsMD, then does a diff of those files on the main branch, then puts all the diffs in a single txt file.

@stephanmeesters stephanmeesters marked this pull request as draft July 6, 2026 19:19
@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR moves 232 identical header and source files from Generals/Code/GameEngine/ and GeneralsMD/Code/GameEngine/ to Core/GameEngine/ to eliminate code duplication between the two game codebases. The migration is driven by scripts/cpp/unify_move_files.py and verified with the PowerShell diff script in the PR description.

  • Files are moved from GeneralsMD to Core (confirmed as 100% identical renames by git), while the corresponding Generals duplicates are deleted; all three CMakeLists are updated atomically.
  • The automation script comments out newly processed entries in its main() as a historical log; the CMakeLists changes correctly uncomment source/header entries in Core and comment them out in Generals and GeneralsMD.

Confidence Score: 5/5

Safe to merge — all 232 file moves are confirmed byte-for-byte identical (git R100 renames) and the three CMakeLists are updated atomically.

Every moved file is a 100% identical rename from GeneralsMD to Core with the corresponding Generals duplicate deleted. The CMakeLists changes are mechanically symmetric: entries uncommented in Core, commented out in both Generals and GeneralsMD. No code logic changed.

No files require special attention. The three CMakeLists changes are the only non-trivial content modifications and they follow the established pattern of prior unification PRs.

Important Files Changed

Filename Overview
Core/GameEngine/CMakeLists.txt Uncomments 116 previously disabled header and source entries across Common, GameClient, and GameLogic — the Core-side half of the three-way CMakeLists sync.
Generals/Code/GameEngine/CMakeLists.txt Comments out all 232 entries whose files were deleted; mirrors the Core uncomment and GeneralsMD comment-out operations symmetrically.
GeneralsMD/Code/GameEngine/CMakeLists.txt Comments out all entries whose files were moved to Core; the GeneralsMD source is the origin of the moved files (R100 git renames).
scripts/cpp/unify_move_files.py Adds 116 newly processed unify_file() calls to the historical log (all commented out post-execution); script logic and CMakeLists modification helpers are unchanged.
Core/GameEngine/Include/Common/BezFwdIterator.h Representative moved header — 100% identical rename from GeneralsMD; content and include guards unchanged.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["unify_move_files.py\nunify_file(ZEROHOUR → CORE)"] --> B["Move file from\nGeneralsMD/ to Core/"]
    A --> C["Delete duplicate from\nGenerals/"]
    A --> D["Comment out entry in\nGeneralsMD/CMakeLists.txt"]
    A --> E["Comment out entry in\nGenerals/CMakeLists.txt"]
    A --> F["Uncomment entry in\nCore/CMakeLists.txt"]
    B --> G["Core/GameEngine/\nInclude + Source"]
    C --> H["Generals file removed"]
    D --> I["GeneralsMD defers to Core"]
    E --> J["Generals defers to Core"]
    F --> K["Core now owns file"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["unify_move_files.py\nunify_file(ZEROHOUR → CORE)"] --> B["Move file from\nGeneralsMD/ to Core/"]
    A --> C["Delete duplicate from\nGenerals/"]
    A --> D["Comment out entry in\nGeneralsMD/CMakeLists.txt"]
    A --> E["Comment out entry in\nGenerals/CMakeLists.txt"]
    A --> F["Uncomment entry in\nCore/CMakeLists.txt"]
    B --> G["Core/GameEngine/\nInclude + Source"]
    C --> H["Generals file removed"]
    D --> I["GeneralsMD defers to Core"]
    E --> J["Generals defers to Core"]
    F --> K["Core now owns file"]
Loading

Reviews (2): Last reviewed commit: "unify: Move various identical files to C..." | Re-trigger Greptile

@stephanmeesters stephanmeesters marked this pull request as ready for review July 6, 2026 19:24
@xezon

xezon commented Jul 8, 2026

Copy link
Copy Markdown

We had such mass move pulls opened in the past but always closed them. The concern is that it creates mass merge conflicts on other branches and adds more compile errors in Generals before ZH is replicated. Generally it is good to first merge select files, and then move a collection of related files to Core. So for example merge all Control Bar files, then move all of them to Core. This is how we did it until now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants