···66show`, and `git format-patch`. It can also parse and apply unified diffs
77generated by the standard `diff` tool.
8899-It supports both standard line-oriented text patches and Git binary patches.
99+It supports standard line-oriented text patches and Git binary patches, and
1010+aims to parse anything accepted by the `git apply` command.
10111112```golang
1213patch, err := os.Open("changes.patch")
···2324// preamble is a string of the content of the patch before the first file
2425```
25262626-## Status
2727+## Development Status
27282828-In development, expect API changes. Patch parsing works, but has not been
2929-tested extensively against real-world patches. Patch application has not been
3030-implemented yet.
2929+Mostly complete, but API changes are possible. Patch parsing and strict
3030+application works and is well-covered by unit tests, but has not been validated
3131+extensively against real-world patches.
31323233## Why another git/unified diff parser?
3334···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.
7979+8080+6. Patches can only be applied in "strict" mode, where the line numbers and
8181+ context of each fragment must exactly match the source file; `git apply`
8282+ implements a search algorithm that tries different lines and amounts of
8383+ context, with further options to normalize or ignore whitespace changes.