neogit icon indicating copy to clipboard operation
neogit copied to clipboard

Scripting with neogit?

Open gegoune opened this issue 4 years ago • 2 comments

Amazing plugin, only touched the surface what it can do and it seems like you have amazing plans for it! I think I will be able to replace fugitive if I could automate some workflows that I have, namely saving changes to the file, committing those changes and pushing to remote. Is it possible with current state of neogit? I guess neogit would need to expose some functions?

Thanks!

gegoune avatar Mar 23 '21 23:03 gegoune

Just to leave my thoughts on the matter: While I do think we'll expose a stable api at some point to use for scripting, it would most likely involve the use of async, so I think we should wait for nvim-lua/plenary.nvim#83 to get merged, transition our code to that and expose an api that way, just so users can have reasonable expectations about the async/await api.

(Also, that way users would need to have plenary, and by extension the async/await set of functions, already installed, so we don't have to worry about that too; and we'd have a place to point to for documentation on the matter :grin:)

RianFuro avatar Mar 24 '21 07:03 RianFuro

@cloggier for now you could look through neogit.lib.

Things that might interest you:

  • cli.lua
  • git/*.lua

TimUntersberger avatar Mar 25 '21 10:03 TimUntersberger