@@ -6,7 +6,8 @@ A Go library for parsing and applying patches generated by `git diff`, `git
66show` , and ` git format-patch`. It can also parse and apply unified diffs
77generated by the standard ` diff ` tool.
88
9- It supports both standard line-oriented text patches and Git binary patches.
9+ It supports standard line-oriented text patches and Git binary patches, and
10+ aims to parse anything accepted by the ` git apply ` command.
1011
1112``` golang
1213patch , err := os.Open (" changes.patch" )
@@ -23,11 +24,11 @@ if err != nil {
2324// preamble is a string of the content of the patch before the first file
2425```
2526
26- ## Status
27+ ## Development Status
2728
28- In development, expect API changes. Patch parsing works, but has not been
29- tested extensively against real-world patches. Patch application has not been
30- implemented yet .
29+ Mostly complete, but API changes are possible . Patch parsing and strict
30+ application works and is well-covered by unit tests, but has not been validated
31+ extensively against real-world patches .
3132
3233## Why another git/unified diff parser?
3334
@@ -75,3 +76,8 @@ implemented yet.
75765 . When reading "traditional" patches (those not produced by ` git ` ), prefixes
7677 are not stripped from file names; ` git apply ` attempts to remove prefixes
7778 that match the current repository directory/prefix.
79+
80+ 6 . Patches can only be applied in "strict" mode, where the line numbers and
81+ context of each fragment must exactly match the source file; ` git apply `
82+ implements a search algorithm that tries different lines and amounts of
83+ context, with further options to normalize or ignore whitespace changes.
0 commit comments