Skip to content

pr_runtime: parse spaced and quoted Git paths - #293

Open
Azusa111 wants to merge 1 commit into
huggingface:mainfrom
Azusa111:codex/fix-git-diff-spaced-paths
Open

Azusa111 wants to merge 1 commit into
huggingface:mainfrom
Azusa111:codex/fix-git-diff-spaced-paths

Conversation

@Azusa111

@Azusa111 Azusa111 commented Dec 2, 2026

Copy link
Copy Markdown

Summary

  • Split Git diff blocks by their header boundary, then decode quoted and unquoted paths using file markers and rename/copy metadata. This keeps test-file changes in test_patch when filenames contain spaces, tabs, quotes, or non-ASCII characters.
  • Use the same path parser for _files_in_patch, so task metadata reports the actual filenames.
  • Add regression tests generated by real git diff, including a rename without hunks.

Test plan

  • Full suite: 2,832 passed, 98 skipped (pytest -q with all extras installed)
  • Affected pipeline tests: 124 passed
  • ruff check ., ruff format --check ., and git diff --check
  • uv build --offline --python .venv/env/bin/python produced an sdist and wheel
  • Checked all 181 published pr_diff reference patches: unchanged source/test classification

Out of scope

  • Changes to scoring or other pipeline behavior.
  • The occurrence rate of these paths in historical pr_runtime tasks has not been measured.

Closes #291

Git quotes paths containing spaces or non-ASCII characters in diff headers. The old header matcher merged their blocks into adjacent source patches, allowing hidden test edits into the source patch and leaving the test patch empty.

Parse file boundaries and Git path metadata consistently for patch splitting and file extraction.

Refs huggingface#291

This branch has not been deployed

No deployments
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.

pr_runtime: split Git diffs with spaced and quoted paths

1 participant