node-gitteh icon indicating copy to clipboard operation
node-gitteh copied to clipboard

How can I stage lines and hunks?

Open demian85 opened this issue 11 years ago • 1 comments

Hi,

I've been working on a 'git-gui' desktop app. I invite you to take a look: https://github.com/demian85/git-watcher

All the current functionality is provided by native git commands and the git-utils module.

Now, to make it more useful, I would like to implement at least the following features:

  • Amend commit: I need to show files from previous commit and allow to stage them in a 'sandbox' to avoid modifying the current repository.
  • Stage by lines and hunks: The same as git-gui.

I've done a bit of research and my conclusion is that there is no way to implement those features without using a native git API.

Can node-gitteh help me? I couldn't find a clue by looking at the old documentation.

Thanks for your help.

demian85 avatar Feb 13 '14 23:02 demian85

@demian85 amending commits is definitely something gitteh can do. Staging changes in the index is something that is available in libgit2, but hasn't been handled in these bindings. The diff / staging methods in libgit2 are what you're after specifically. This lib is fairly inactive at the moment (pending a contributor - hint hint :D), you might want to see if nodegit has made available the functionality you're after in Node.

samcday avatar Feb 17 '14 23:02 samcday