File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 11# go-gitdiff
22
3+ [ ![ GoDoc] ( https://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff?status.svg )] ( http://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff )
4+
35A Go library for parsing and applying patches generated by ` git diff ` , `git
46show` , and ` git format-patch`. It can also parse and apply unified diffs
57generated by the standard ` diff ` tool.
68
7- It supports both standard line-oriented / text patches and Git binary patches.
9+ It supports both standard line-oriented text patches and Git binary patches.
10+
11+ ``` golang
12+ patch , err := os.Open (" changes.patch" )
13+ if err != nil {
14+ log.Fatalf (err)
15+ }
16+
17+ files , preamble , err := gitdiff.Parse (patch)
18+ if err != nil {
19+ log.Fatalf (err)
20+ }
21+
22+ // files is a slice of *gitdiff.File describing the files changed in the patch
23+ // preamble is a string of the content of the patch before the first file
24+ ```
825
926## Status
1027
11- In development, most functionality is currently missing, incomplete, or broken.
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.
1231
1332## Why another git/unified diff parser?
1433
You can’t perform that action at this time.
0 commit comments