Add links to alternatives in README

This commit is contained in:
Billy Keyes
2019-03-12 22:50:39 -07:00
parent d8a0cc90d1
commit 5ddc0cc7e6
+16 -9
View File
@@ -1,20 +1,27 @@
# go-gitdiff
A Go library for parsing and applying patches generated by `git diff`, `git
show`, and `git format-patch`.
show`, and `git format-patch`. It can also parse and apply unified diffs
generated by the standard `diff` tool.
## Why another diff parser?
## Why another git/unified diff parser?
Several libraries with similar functionality already exist, so why make
another?
[Several][sourcegraph] [packages][sergi] with [similar][waigani]
[functionality][seletskiy] exist, so why did I write another?
1. No other libraries I found support binary diffs, as generated with the
`--binary` flag. This is the main reason for writing a new library.
`--binary` flag. This is the main reason for writing a new library, as the
format is pretty different from line-oriented diffs and is unique to Git.
2. Most other libraries only parse patches, so you need something else to apply
2. Most other packages only parse patches, so you need another package to apply
them (and if they do support applies, it is only for text files.)
3. The goal is to eventually accept anything that `git apply` accepts, based on
the code in [`apply.c`](https://github.com/git/git/blob/master/apply.c).
3. This package aims to accept anything that `git apply` accepts, and closely
follows the logic in [`apply.c`](https://github.com/git/git/blob/master/apply.c).
4. It seemed like a fun thing to write.
4. It seemed like a fun thing to write and a good way to learn more about Git.
[sourcegraph]: https://github.com/sourcegraph/go-diff
[sergi]: https://github.com/sergi/go-diff
[waigani]: https://github.com/waigani/diffparser
[seletskiy]: https://github.com/seletskiy/godiff