Skip to content

Ports TG's icon merge conflict tool - #38821

Closed
Inorien wants to merge 19 commits into
vgstation-coders:Bleeding-Edgefrom
Inorien:tg-dmi-merge-tool
Closed

Ports TG's icon merge conflict tool#38821
Inorien wants to merge 19 commits into
vgstation-coders:Bleeding-Edgefrom
Inorien:tg-dmi-merge-tool

Conversation

@Inorien

@Inorien Inorien commented Jan 1, 2026

Copy link
Copy Markdown
Collaborator

What this does

Many years ago, someone called DrCelt ported a dmi conflict resolver from Bay (tools/dmitool). This resolver was written in Java but doesn't seem to work any more or be used. And you have to install Java to use it.
TG has a more modern version of something very similar written in Python. This PR ports most of that tool and makes a couple of changes.

The tool itself works like this:

  • Checks DMIs with conflicts
  • If the conflict is trivial (e.g. adding/changing different icons within the same DMI) it resolves them. No need to download the Bleeding-Edge DMI and redo the changes.
  • If the conflict is non-trivial, e.g. if the same icon was modified, it modifies the DMI:
    • Creates new icons - the BASE, the incoming and the current local versions all marked with !CONFLICT!. You need to open your dmi editor and straighten out the changes, then delete the extra icons then remove the !CONFLICT! and whatever version tag follows it then commit+push the fixed dmi.

The TG way of running it via git hooks is currently not implemented here. Maybe it'll be added, let's see if we need it - it requires developers to run an extra step one time to set the hook up, but the benefit is that the conflict resolution script runs automatically when you pull/merge to local. If it's a trivial conflict then its very hands-off, if its nontrivial you need to resolve it manually in a dmi editor.

If you don't have the hook set up, i.e. how this branch is set up right now, when you pull/merge and your git detects a dmi conflict you run tools/dmi/Resolve Icon Conflicts.bat. This sets up a Python venv if not already done then does the above check, giving you feedback on what to do next.

In addition, something I don't think TG has right now, this tool will also run as part of the CI. When you open a PR and the CI detects an icon conflict, it will run the tool and detect if its a trivial conflict or not. It will then post a comment in the PR that explains what to do next. Until DMI conflicts are resolved, the CI will fail.

Why it's good

Less agony for developers working on sprites, less awkward workaround when resolving icon conflicts

How it was tested

  • On branch with no icon conflicts it exits cleanly
  • Set up two branches with an icon edited to create a conflict
    • for trivial conflict, it resolved automatically when running the bat
    • for nontrivial conflict it created the !CONFLICT! states
  • CI testing coming soon

Changelog

No user-facing change

@Inorien Inorien added Sprites Pretty colors. ❤️ Quality of Life ❤️ This is a change that removes hassle and improves quality of life. Tools ✋ Do Not Merge ✋ Don't you do it. labels Jan 1, 2026
@Inorien

Inorien commented Jan 1, 2026

Copy link
Copy Markdown
Collaborator Author

need to verify CI

@Inorien

Inorien commented Jan 6, 2026

Copy link
Copy Markdown
Collaborator Author

will straighten this out this weekend, been busy

@Inorien

Inorien commented Jan 10, 2026

Copy link
Copy Markdown
Collaborator Author

fucking
CI doesnt run if github detects a conflict
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

@Exxion

Exxion commented Jan 11, 2026

Copy link
Copy Markdown
Member

This resolver was written in Java but doesn't seem to work any more or be used.

It does actually work (or at least did in 2024), but you have to set it up manually on your own end. I wouldn't necessarily trust it in complex cases, either. A newer tool is certainly a good thing.

Comment thread .gitattributes

# dmi icon merger hook
# needs additional setup, see tools/dmitool/merging.txt
# Run tools/dmi/Resolve Icon Conflicts.bat after a conflicted merge

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why remove the instructions to set it up properly instead of just updating them?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my bad - I was under the impression the old tools didn't work and that this would be a full replacement.
given my grand plan to integrate this into the CI looks like it isn't going to work i'm going to re-do this as an alternative to the java tool

@Inorien

Inorien commented Jan 17, 2026

Copy link
Copy Markdown
Collaborator Author

i will reopen this when i get back to it, fed up of seeing it on the pr list

@Inorien Inorien closed this Jan 17, 2026
@Eneocho Eneocho added the Derelict For content PRs that were closed, but contain functional features/code to salvage. label Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Derelict For content PRs that were closed, but contain functional features/code to salvage. ✋ Do Not Merge ✋ Don't you do it. ❤️ Quality of Life ❤️ This is a change that removes hassle and improves quality of life. Sprites Pretty colors. Tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants