Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I stage lines and hunks? #146

Closed
demian85 opened this issue Apr 2, 2014 · 9 comments
Closed

How can I stage lines and hunks? #146

demian85 opened this issue Apr 2, 2014 · 9 comments

Comments

@demian85
Copy link

demian85 commented Apr 2, 2014

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 nodegit help me? I couldn't find a clue by looking at the old documentation.

Thanks for your help.

pd: I've asked the same question in the node-gitteh project: libgit2/node-gitteh#71

@demian85
Copy link
Author

hello?

@johnhaley81
Copy link
Collaborator

I don't know if we can do this yet but I want to try and get it in for 0.2.4 milestone. I'll update this issue if it seems to be not do-able right now.

@johnhaley81
Copy link
Collaborator

We're still trying to get this in. @orderedlist have you made any progress on this?

@orderedlist
Copy link
Collaborator

Currently working on custom staging. The only process available in libgit2 for this at the moment involves creating a new IndexEntry, writing a blob to the repo with the desired version of the file (not the diff, the full modified file), setting the path and the blob on the indexEntry, and using index.add(entry) to write that item to the index.

Not the prettiest, but at least it's possible. Hopefully I'll be able to add examples soon.

@johnhaley81
Copy link
Collaborator

I'm going to remove this from the 0.3.0 release but we'll need some examples for this still.

@johnhaley81 johnhaley81 removed this from the 0.3.0 milestone Mar 10, 2015
@richtmat
Copy link

are there any news on this issue? I would like to stake hunks as well.

@johnhaley81
Copy link
Collaborator

Implemented in #678

@richtmat
Copy link

@johnhaley81 sorry, didn't see that. thanks!

@johnhaley81
Copy link
Collaborator

No worries. Should have updated the issue as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants