[PR #2197] merge_check: distinguish legacy-encoded lines before reporting duplicates #2202

Open
opened 2026-11-26 21:20:23 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/2197
Author: @EdenBendheim
Created: 11/26/2026
Status: 🔄 Open

Base: main ← Head: ubiq/merge-check-blob-comparison


📝 Commits (1)

  • ead43b5 merge_check: distinguish legacy-encoded lines before reporting duplicates

📊 Changes

2 files changed (+25 additions, -4 deletions)

View changed files

📝 scripts/merge_check.py (+6 -4)
📝 tests/test_merge_check.py (+19 -0)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/2197 **Author:** [@EdenBendheim](https://github.com/EdenBendheim) **Created:** 11/26/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `ubiq/merge-check-blob-comparison` --- ### 📝 Commits (1) - [`ead43b5`](https://github.com/ubiquitarianism/leonida/commit/ead43b578758302c926f37f5515840f39c1edd92) merge_check: distinguish legacy-encoded lines before reporting duplicates ### 📊 Changes **2 files changed** (+25 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `scripts/merge_check.py` (+6 -4) 📝 `tests/test_merge_check.py` (+19 -0) </details> ### 📄 Description Claimed in the coordination issue as: MERGE-CHECK-LOSSLESS-BLOB-COMPARISON ([claim](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7183431216)) 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#2202
No description provided.