merge_check: distinguish legacy-encoded lines before reporting duplicates #2197

Open
github-bot wants to merge 1 commit from github-bot/gh-2197 into main AGit
Owner

@⁠EdenBendheim on GitHub · 2026-11-26 05:23 UTC · original
EdenBendheim:ubiq/merge-check-blob-comparison → main · +25 −4 · 2 files · 1 commits · open

Claimed in the coordination issue as: MERGE-CHECK-LOSSLESS-BLOB-COMPARISON (claim)

The merge checker rejected a clean PR when its new lines differed from existing text only in non-UTF-8 bytes. For example, CP1252 é and è both became the same replacement character before comparison. The checker now preserves those bytes during comparison and converts them for display only after identifying a real duplicate.

The regression uses a temporary Git repository with distinct and byte-identical blocks. On main a73a57e13 the distinct block triggered three false duplicate lines. On ead43b578, the distinct block passes and the identical block is still reported with printable samples. All 25 test_merge_check.py tests passed with Python 3.12 on macOS. The changed-file game-data check and git diff --check passed.

GPUs tested: n/a. All tests used synthetic inputs.

AI-assisted: yes. Created with gpt-6.2-astra in Codex.

**@⁠EdenBendheim** on GitHub · 2026-11-26 05:23 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2197) `EdenBendheim:ubiq/merge-check-blob-comparison` → `main` · +25 −4 · 2 files · 1 commits · open Claimed in the coordination issue as: MERGE-CHECK-LOSSLESS-BLOB-COMPARISON ([claim](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608)) The merge checker rejected a clean PR when its new lines differed from existing text only in non-UTF-8 bytes. For example, CP1252 `é` and `è` both became the same replacement character before comparison. The checker now preserves those bytes during comparison and converts them for display only after identifying a real duplicate. The regression uses a temporary Git repository with distinct and byte-identical blocks. On main `a73a57e13` the distinct block triggered three false duplicate lines. On `ead43b578`, the distinct block passes and the identical block is still reported with printable samples. All 25 `test_merge_check.py` tests passed with Python 3.12 on macOS. The changed-file game-data check and `git diff --check` passed. GPUs tested: n/a. All tests used synthetic inputs. AI-assisted: yes. Created with gpt-6.2-astra in Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:22:00 +00:00
Author
Owner

@⁠DeadlyChirp on GitHub · 2026-11-26 10:01 UTC · original · edited 2026-11-26 10:30 UTC

Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main.

  • tests/test_merge_check.py: 25 passed, 7 subtests passed (main: 24 passed, 5 subtests).

(AI-assisted test run; output checked by hand.)

**@⁠DeadlyChirp** on GitHub · 2026-11-26 10:01 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2197#issuecomment-7188807612) · edited 2026-11-26 10:30 UTC Tested on Windows 11, Python 3.12.10, with this PR merged onto current upstream main. - `tests/test_merge_check.py`: 25 passed, 7 subtests passed (main: 24 passed, 5 subtests). (AI-assisted test run; output checked by hand.)
Author
Owner

@⁠real-rusher on GitHub · 2026-11-26 10:06 UTC · original

Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_merge_check.py: 25 tests OK. The PR's test file against main's scripts/merge_check.py: 1 failure, so the new test fails on main and passes with the fix. compileall clean.

AI-assisted: yes (Claude Code)

**@⁠real-rusher** on GitHub · 2026-11-26 10:06 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/2197#issuecomment-7188918583) Verified on main a73a57e1 (Ubuntu 24.04 x86-64, Python 3.13, no GPU). Merges cleanly. With this PR, python -I tests/test_merge_check.py: 25 tests OK. The PR's test file against main's scripts/merge_check.py: 1 failure, so the new test fails on main and passes with the fix. compileall clean. AI-assisted: yes (Claude Code)
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2197/head:github-bot/gh-2197'
git switch 'github-bot/gh-2197'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2197'
git switch 'github-bot/gh-2197'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2197'
git switch 'github-bot/gh-2197'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2197'
git switch 'main'
git merge --squash 'github-bot/gh-2197'
git switch 'main'
git merge --ff-only 'github-bot/gh-2197'
git switch 'main'
git merge 'github-bot/gh-2197'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.