Skip to content

replicating index.add_all with gix #1031

Answered by Byron
Lunarequest asked this question in Q&A
Discussion options

You must be logged in to vote

Currently there is no high-level API to implement git add similarly to how git add would, or how one would do it with git2.

As a general rule of thumb, gix (the crate) is likely to be able to do what you are looking for if gix (the CLI) can do it. Using the CLI for discovery might have advantages as it follows the terminology of the git CLI more closely.

Please also note that technically, you can implement a git add with gix today, but it will be very low-level and cumbersome. Further, it's not yet possible to easily create a tree from an index, which would be needed for a commit.

With this said, it's not yet on the roadmap either as cargo doesn't need that functionality on the roadmap as c…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Lunarequest
Comment options

@Byron
Comment options

Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants