Update status and add example in README

This commit is contained in:
Billy Keyes
2019-04-14 19:35:48 -07:00
parent 31777bd4b5
commit 37fcc9a950
+21 -2
View File
@@ -1,14 +1,33 @@
# go-gitdiff
[![GoDoc](https://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff?status.svg)](http://godoc.org/github.com/bluekeyes/go-gitdiff/gitdiff)
A Go library for parsing and applying patches generated by `git diff`, `git
show`, and `git format-patch`. It can also parse and apply unified diffs
generated by the standard `diff` tool.
It supports both standard line-oriented / text patches and Git binary patches.
It supports both standard line-oriented text patches and Git binary patches.
```golang
patch, err := os.Open("changes.patch")
if err != nil {
log.Fatalf(err)
}
files, preamble, err := gitdiff.Parse(patch)
if err != nil {
log.Fatalf(err)
}
// files is a slice of *gitdiff.File describing the files changed in the patch
// preamble is a string of the content of the patch before the first file
```
## Status
In development, most functionality is currently missing, incomplete, or broken.
In development, expect API changes. Patch parsing works, but has not been
tested extensively against real-world patches. Patch application has not been
implemented yet.
## Why another git/unified diff parser?