Add go-git to Appendinx B: embedding#998
Conversation
ben
left a comment
There was a problem hiding this comment.
This is definitely a good addition to the book, thanks for writing it up! It just needs a bit of tuning.
| Even non-developer applications, such as document editors, could potentially benefit from version-control features, and Git's model works very well for many different scenarios. | ||
|
|
||
| If you need to integrate Git with your application, you have essentially three choices: spawning a shell and using the Git command-line tool; Libgit2; and JGit. | ||
| If you need to integrate Git with your application, you have essentially next options: |
There was a problem hiding this comment.
Let's instead say this:
If you need to integrate Git with your application, you have essentially two options: spawn a shell and call the
gitcommand-line program, or embed a Git library into your application. Here we'll cover command-line integration and several of the most popular embeddable Git libraries.
| === go-git | ||
|
|
||
| (((go-git)))((("Go"))) | ||
| In case you want to integrate Git into a service written in Golang, there also is a pure Go library implmentation. In contrast to using a Libgit2 bindings, this implementation does not have any native dependencies, not prone to memory management errors and is transparent for standard Golang performance analysis tooling like CPU, Memory profilers, race detector, etc. |
There was a problem hiding this comment.
- Could you reformat to the single-sentence-per-source-line convention? It'll make diffs in the future much more readable.
- Let's try to avoid disparaging other libraries. It may be true that Go is better at managing memory than C, but it may also be true that libgit2 has some features that go-git does not.
There was a problem hiding this comment.
Plus there's a typo "implmentation"
There was a problem hiding this comment.
Thank you for your kind suggestions!
Let's try to avoid disparaging other libraries.
This of course was not an intention, thank you for noticing and pointing it out.
Will re-word asap, and also will appreciate any further improvement suggestions.
| (((go-git)))((("Go"))) | ||
| In case you want to integrate Git into a service written in Golang, there also is a pure Go library implmentation. In contrast to using a Libgit2 bindings, this implementation does not have any native dependencies, not prone to memory management errors and is transparent for standard Golang performance analysis tooling like CPU, Memory profilers, race detector, etc. | ||
|
|
||
| go-git is focused on extensibility, compatibility and supports most of the plumbing APIs, wich is documented https://github.com/src-d/go-git/blob/master/COMPATIBILITY.md[] |
|
|
||
| go-git is focused on extensibility, compatibility and supports most of the plumbing APIs, wich is documented https://github.com/src-d/go-git/blob/master/COMPATIBILITY.md[] | ||
|
|
||
| Here is a basic example of using Go APIs |
There was a problem hiding this comment.
Usually when we have a sentence introducing an example, we end it with a period or a colon. This seems like a great place for a colon.
| }) | ||
| ----- | ||
|
|
||
| As soon as you have a `Repository` instance, |
There was a problem hiding this comment.
This also seems like a good place for a colon:
As soon as you have a
Repositoryinstance, you can access information and perform mutations on it:
|
|
||
| ==== Advanced Functionality | ||
|
|
||
| go-git has few notable advanced features, one of wich is a pluggable storage system, similar to Libgit2 backends, with a default implementation of in-memory storage. |
There was a problem hiding this comment.
This is a lot of commas. I'd suggest splitting it up like this:
go-git has few notable advanced features, one of wich is a pluggable storage system, which is similar to Libgit2 backends. The default implementation is in-memory storage, which is very fast.
|
|
||
| That way all operations over the repository become bazingly fast as they never hit the disk. | ||
|
|
||
| Other storage implementaions include ability to store references, objects and configuration in a database i.e https://github.com/src-d/go-git/tree/master/_examples/storage[] an Aerospike. |
There was a problem hiding this comment.
Let's delete the sentence before this one, and maybe something like this here:
Pluggable storage provides many interesting options. For instance, https://github.com/src-d/go-git/tree/master/_examples/storage[Aerospike] allows you to store references, objects, and configuration in a database.
| Another feature is a flexible filesystem abstraction. | ||
| Using https://godoc.org/github.com/src-d/go-billy#Filesystem[] it is easy to store all the files in different way i.e by packing all of them to a single archive on disk or by keeping them all in-memory. | ||
|
|
||
| Another advanced use-case includes a fine-tunable HTTP client https://github.com/src-d/go-git/blob/master/_examples/custom_http/main.go[] |
There was a problem hiding this comment.
Try to add a bit of context or a pretty display to URLs, instead of dropping them at the end of sentences:
Another advanced use-case includes a fine-tunable HTTP client, such as the one found at https://github.com/src-d/go-git/blob/master/_examples/custom_http/main.go[].
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
Signed-off-by: Alexander Bezzubov <bzz@apache.org>
a2a4424 to
d9a1396
Compare
|
Brilliant. Thanks! |
Adds one more way of embedding Git in your application using go-git project.
go-git is quite mature, well maintained and used in production by a multiple companies implementation of Git in Golang.
Please, let me know if you guys think it could be of any value for the readers.