logoalt Hacker News

MBCooktoday at 12:36 AM2 repliesview on HN

Isn’t git already just an interface over libgit? How is that different?


Replies

tredre3today at 12:44 AM

Git is famously not built around a (reusable) library, hence why we have things like libgit2 (unrelated to git) and why any porcelain on top of git has to resort to calling the binary and parsing its text output.

show 1 reply
schacontoday at 2:43 AM

libgit.a isn't reentrant. It will call `die()` on many errors. If you link to it in a long running binary, it will kill your process on error.

Libgit2 is meant to address this and I was heavily involved in the development of that project 15 years ago. It's great but it's not feature complete and it's development is also completely separate from git development, so it's out of sync and constantly struggling to keep up.