git2-rs
git2-rs copied to clipboard
Stage/apply lines
It's an useful feature in git (gui) clients to be able to select individual lines to stage and commit, not just hunks or files. I saw that nodegit implemented it a good while back. Can git2-rs have a feature like that too?
nodegit seems to be replacing the selected lines in the affected blob and then calculating a new diff based on that.
If it's not against some design principle of git2-rs, I'd be happy to implement it too with some design guidance.
git2-rs is just a wrapper around libgit2 - this would be the appropriate place to add this. that being said I would love to see libgit2 support this feature👍
Thanks for the quick response. I opened a feature request with libgit2 too. In the meanwhile I'll go on and do it in rust for my project as I can't help writing it in C...
if anyone needs an inspiration on how to do this, I implemented it now in extrawurst/gitui#571
it is based off of nodegits implementation