You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Patch Target Paths: Resolve targets the way patch -p1 does for directory-tree diffs (diff -Naur pkg.orig pkg, including created and deleted files) and for backup-file diffs (diff -u file.orig file). When a target is missing but exists without its leading directory, patch that file and print a warning.
Already-Applied Hunks: Skip a hunk with a warning when it can only be placed by fuzzy matching and its result is already in the file, so re-applying a patch no longer duplicates its changes. Hunks whose context still matches exactly always apply, so intentional duplicates keep working. Hunks that only delete lines, and hunks whose context still matches exactly after they were applied (such as appends at the end of a list), are not detected.
Git Executable Mode: Apply Git mode changes between 100644 and 100755 on Unix after the content is written, including created files (new file mode 100755), mode-only patches, -R, and --dry-run. A mode change for a file that neither exists nor is created by the patch fails before anything is written, and --atomic skips modes when the batch is discarded. Library callers can read the changes with parse_git_mode_changes().
Fixed
Unified Diff Parsing: Recognize diff -Naur headers, strip timestamps from --- / +++ file headers (including timestamps whose tab separator was expanded to spaces), decode Git C-quoted paths, and distinguish file headers from hunk content that begins with --- or +++.
Line Endings: Preserve CRLF and mixed line endings when patching a file. Previously the whole file was rewritten with LF endings; now unchanged lines keep their own ending and added lines use the file's most common one.
Final Newline: Keep a file's final newline unless the patch changes its last line. Previously any hunk that reached the end of the file applied the patch's \ No newline at end of file state, so a hunk ending in unchanged context could add or remove the final newline. Now a line kept from the file keeps its own newline and a line added by the patch follows the patch's marker, matching GNU patch.
CLI Failure Reporting: Exit with an error instead of succeeding silently when the input contains context diffs (diff -c), Git renames or copies, Git binary patches, or symlink and submodule modes. Warn when a Git executable-mode change is not applied.