NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
3.93k stars 231 forks source link

use libgit2? #2

Open bfredl opened 4 years ago

bfredl commented 4 years ago

Interesting project. Are you planning/considering to use libgit2? There seems to be nice lua bindings. I was thinking on prototyping my own git integration from scratch, but I could start with your stuff and try to move things over from cli to luagit2. If this sounds interesting.

TimUntersberger commented 4 years ago

Libgit2 seems like a better solution than writing pure cli commands. How could we then do the git command history stuff?

bfredl commented 4 years ago

@TimUntersberger good question. probably command history will handled in Neovim instead (history for ex commands, for instance, like :Neogit split mybranch and whatever)

TimUntersberger commented 4 years ago

Just to make sure, are we talking about the same thing? I am talking about for example: git status --.... this then gets added to the history along with the stdout, stderr and the return code. I guess we could generate them ourselves?

bfredl commented 4 years ago

@TimUntersberger yea I am not sure about that. But it is not "all or nothing", we can still cli as the baseline, and slowly move things to libgit2 one at at time.

TimUntersberger commented 4 years ago

If you want to you can try changing an existing implementation to use libgit2, so we can see how this would work. The easiest one would probably be the status command. Also how can you include luarocks dependencies?

bfredl commented 4 years ago

Also how can you include luarocks dependencies?

We don't know yet :sweat_smile: . I will just hack it into my lua path for now, and discuss with a bunch of ppl (you, packer.nvim, neovim core team) how/if/when we will "do" luarocks deps.

bfredl commented 4 years ago

soo it turns out luagit2 is not compatible with libgit2 1.0. I will see how much effort to fix it (probably not too much, as uses LuaNativeObject)

bfredl commented 4 years ago

WIP https://github.com/libgit2/luagit2/pull/9 should be too hard to finish

TimUntersberger commented 4 years ago

should be too hard

Do you mean shouldn't be too hard ? Nice work!

bfredl commented 4 years ago

I cannot into English grammar :]

TimUntersberger commented 4 years ago

No worries :-) I am excited to see how we could use libgit2! Have you tried neogit yet? How do you feel about the notifications? When i initially developed this I thought it might be a bit too much, but I just went with it anyway, because the concept feels really cool.

bfredl commented 4 years ago

actually not, there so much neovim lua stuff that I am being behind on :sweat_smile:. I first want to do fugitive style Read/WriteBufCmd and a simple gitgutter (but with decorations instead of signs, it is 2020 already). But I will "try" the neogit experience for sure :]

TimUntersberger commented 4 years ago

decorations instead of signs

👀

What exactly do you mean by decorations?

But I will "try" the neogit experience for sure :]

You could experience a few bugs ... 😅

bfredl commented 4 years ago

What exactly do you mean by decorations?

For instance