8000 Teach the library to provide support for partial staging · Issue #195 · libgit2/libgit2sharp · GitHub
[go: up one dir, main page]

Skip to content
Teach the library to provide support for partial staging #195
Closed
@kaisellgren

Description

@kaisellgren

I have no idea how doable this is, but I'd really love to see a feature that allows to stage (or unstage) parts of files between the index and the working copy.

Git already provides this through the unintuitive git add -p where you can select what to do per chunk:

Z:\www\test-repo>git add -p
diff --git a/fuz.psd b/fuz.psd
index 191f66f..84b1bf2 100644
--- a/fuz.psd
+++ b/fuz.psd
@@ -1 +1 @@
-fuz
+fgdfgdfgdfg
Stage this hunk [y,n,q,a,d,/,e,?]?

I'm not sure how the API would look like, but I think it would give you the chunks that it finds (a list of chunk objects?) and you can then either stage/unstage them or you can manually alter the chunks (i.e. reset the chunk contents?).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0