Replies: 3 comments 1 reply
-
There is a nice example for how to do this with granularity of files here in onefetch. In order to bring that down to lines granularity one will have to make use of a diff_resource_cache() which unfortunately right now isn't tightly integrated into the index-worktree diff objects yet so it would require some fiddling. Examples are plentiful in the codebase though if you are interested to give it a try nonetheless. |
Beta Was this translation helpful? Give feedback.
-
I understand you refer for example to this : https://github.com/Byron/gitoxide/blob/c4e0a82ec9948ed0d9876a50b156d1ba30e2ad77/gix/tests/object/tree/diff.rs#L11-L53 ? Does that work for comparing the workdir to the index ? I'll try. Thanks. |
Beta Was this translation helpful? Give feedback.
-
BTW, the reason I ask is I'm trying to replace git2 with gix in broot: https://dystroy.org/broot/#check-git-statuses |
Beta Was this translation helpful? Give feedback.
-
I'm looking for the equivalent of diff_index_to_workdir, which gives the number of lines added/removed in work directory compared to index.
Is it possible to get it or compute it with gix, starting from a Repository ?
Beta Was this translation helpful? Give feedback.
All reactions