Repository navigation
fix: improve apply_patch command detection for path prefixes and variants - #9498
yuvrajangadsingh wants to merge 13 commits into
Conversation
…ants - Add is_apply_patch_command() helper to extract filename from paths (handles /usr/bin/apply_patch, ./apply_patch) - Add apply-patch (hyphenated) to recognized command variants - Update Tree-sitter query to match apply-patch in heredoc scripts - Add symlink for apply-patch in PATH setup (arg0/src/lib.rs) - Add 5 new tests for edge cases Fixes openai#2235
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Hi @etraut-openai, this PR has been open for a couple weeks. Would you be able to take a look when you have a chance? It improves the apply_patch command detection to handle path prefixes and variants. |
|
@bolinfest Since you commented on issue #2235, would you mind taking a look at this fix as well? |
|
While this has historically been a problem (certainly when #2235 was originally opened), reports have died down considerably. Accepting this change would paper over errors and potentially result in incorrect behavior if, for some reason, you had your own We have also refined the custom |
|
As such, thank you for your submission, but we are not going to take this solution. |
Summary
Fixes #2235
The
apply_patchcommand detection was failing for certain edge cases reported by users:/usr/bin/apply_patch(absolute path prefix)./apply_patch(relative path prefix)apply-patch(hyphenated variant)Changes
apply-patch/src/invocation.rsis_apply_patch_command()helper that extracts the filename from path-prefixed commandsapply-patchto theAPPLY_PATCH_COMMANDSarrayapply-patchin heredoc scriptsarg0/src/lib.rsHYPHENATED_APPLY_PATCH_ARG0constantapply-patchinvocationsapply-patchin PATHTest plan