lusingander / serie

A rich git commit graph in your terminal, like magic 📚
MIT License
435 stars 13 forks source link

consider using libgit instead of wrapping git commands #16

Closed JeremiahSecrist closed 3 months ago

JeremiahSecrist commented 3 months ago

check out:

Its a way to have a more direct access to git's features with stable interactions. Consider this the equivalent of using an api vs web scraping. I hope this helps!

lusingander commented 3 months ago

Thanks for sharing, I am aware of libgit2 but choose not to use it.

alerque commented 3 months ago

The Git Oxide crates are quite a bit easier to work with and in many cases faster than libgit2. Not quite as feature complete, so you have to look ahead to what features you'll need before going that route. In any case I second the suggestion to use a library and handle the Git interaction directly rather than shelling out to the system binary. The latter is quick and dirty to get started with but a brittle long term solution.

lusingander commented 3 months ago

Yes, using the git library implemented by pure Rust is certainly an option. As you say, we need to consider whether the required functions are implemented as expected. At least in its current state, the application is not very complex and there is little impact on performance, so I think it is unnecessary.