diff options
| author | QemmHD <stephenlethco2@gmail.com> | 2026-11-24 21:35:37 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-24 21:35:37 -0500 |
| commit | 7ae1dd3de34f1542242bc8ccfc80d9b97d20cc01 (patch) | |
| tree | 2b0de9b86bb14093a1cd9bfaaa6a42a4adc120da /scripts | |
| parent | 0c3c56b9e90dbcb918035c693193c0aa06ea43f9 (diff) | |
| parent | d6031591098839381596e391aa93f36aaaa0fd9d (diff) | |
Merge pull request #1226 from IlyassRS3/carry/old-9973-merge-check-rev-paths
Merging.
**Why merged:** merge_check passes git arguments after a `--` boundary, so a path or ref that starts with `-` can't be read as an option. xel1uz approved it.
**Why it's good:** Own tests: 24 passed.
Tested on Windows 11 / RTX 4070 SUPER: merged alone onto main b4b7756e8. With it in, the repo-consistency set (cmake/translator-deps, shader_stage_resume, runtime_paths, docs, make_game, no-game-data, run_semantic_tests, ctest_registration) gives 578 passed / 5 skipped / 0 failed, and check_no_game_data on the changed files is clean. git merge-tree against current main 3ff2a2adc (after #984): no conflicts. Security read of the three-dot diff: no binaries, game data, downloads, network calls or CI changes.
AI-assisted (Claude Code, Claude Opus 5.5).
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/merge_check.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/merge_check.py b/scripts/merge_check.py index 81bb3368a..e270cbe00 100644 --- a/scripts/merge_check.py +++ b/scripts/merge_check.py | |||
| @@ -65,7 +65,7 @@ def _merged_pr_number(subject): | |||
| 65 | 65 | ||
| 66 | 66 | ||
| 67 | def prior_merges(repo, main, numbers, depth): | 67 | def prior_merges(repo, main, numbers, depth): |
| 68 | out = git(repo, "log", main, "--first-parent", f"-n{depth}", "--format=%H%x09%s").stdout | 68 | out = git(repo, "log", "--first-parent", f"-n{depth}", "--format=%H%x09%s", main, "--").stdout |
| 69 | hits = {number: [] for number in numbers} | 69 | hits = {number: [] for number in numbers} |
| 70 | for line in out.split("\n"): | 70 | for line in out.split("\n"): |
| 71 | sha, _, subject = line.partition("\t") | 71 | sha, _, subject = line.partition("\t") |
| @@ -113,7 +113,7 @@ def duplicates(repo, main, tree, min_length, block=3): | |||
| 113 | patch = git(repo, "-c", "core.quotePath=true", "diff", "--unified=0", "--no-color", "--no-renames", | 113 | patch = git(repo, "-c", "core.quotePath=true", "diff", "--unified=0", "--no-color", "--no-renames", |
| 114 | "--inter-hunk-context=0", "--src-prefix=a/", "--dst-prefix=b/", "--no-relative", | 114 | "--inter-hunk-context=0", "--src-prefix=a/", "--dst-prefix=b/", "--no-relative", |
| 115 | "--no-ext-diff", "--no-textconv", "--ignore-submodules=all", | 115 | "--no-ext-diff", "--no-textconv", "--ignore-submodules=all", |
| 116 | main, tree).stdout | 116 | main, tree, "--").stdout |
| 117 | for line in patch.split("\n"): | 117 | for line in patch.split("\n"): |
| 118 | if line.startswith("diff --git "): | 118 | if line.startswith("diff --git "): |
| 119 | path, added = None, None | 119 | path, added = None, None |
| @@ -132,7 +132,7 @@ def duplicates(repo, main, tree, min_length, block=3): | |||
| 132 | 132 | ||
| 133 | def windows(rev, path): | 133 | def windows(rev, path): |
| 134 | # New files are already left out above (--- /dev/null), so a failed read is a real Git error, not a new file. | 134 | # New files are already left out above (--- /dev/null), so a failed read is a real Git error, not a new file. |
| 135 | r = git(repo, "show", f"{rev}:{path}") | 135 | r = git(repo, "show", f"{rev}:{path}", "--") |
| 136 | lines = [(number, text) for number, raw in enumerate(r.stdout.split("\n"), 1) if (text := raw.strip())] | 136 | lines = [(number, text) for number, raw in enumerate(r.stdout.split("\n"), 1) if (text := raw.strip())] |
| 137 | content = [text for _, text in lines] | 137 | content = [text for _, text in lines] |
| 138 | return lines, Counter(tuple(content[i:i + block]) for i in range(len(content) - block + 1)) | 138 | return lines, Counter(tuple(content[i:i + block]) for i in range(len(content) - block + 1)) |