Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> * Create new blobs for the added/updated files. > > * Create updated tree objects. This can get tedious. If you update a file in /a/b/c, there's at least 3 new tree objects that you'll need to update.

You can do it this way, but the tree API will also take deep paths and recursively write all the subtrees for you and just return the new highest level tree SHA. You also technically don't need to write the blobs first to get the shas, the tree API can optionally take a tree.content field instead of the tree.sha field if you want it to write the blob and update the tree automatically for you.

As for examples, I'll do a blog post soon with some examples and we'll probably add a slightly higher level API more like what Gist has. For now learning the fairly straightforward object model and writing some client level abstraction shouldn't be too difficult.



Thanks for the tip Scott, some examples would be awesome and much appreciated. I feel like I can make it work by stumbling around for a while, but in the end I'm more interested in building something that makes commits, not the actual git internals code.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: