Skip to content

Expose git_diff_blobs API #548

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

Merged
merged 3 commits into from
Apr 13, 2020
Merged

Conversation

staktrace
Copy link
Contributor

Adds a diff_blobs method on the Repository which exposes the git_diff_blobs API in libgit2. The patch should be functionally complete although I haven't tested it extensively. The example app changes could be improved, but I wanted to get some feedback first as to whether this patch would be acceptable or not, and if any more fundamental changes are needed.

Thanks!

@staktrace
Copy link
Contributor Author

Hm, looks like I wrote my patches against alex's fork which is stale. I can rebase against the master, but would like feedback on the main approach first.

In particular, this makes the file callback optional as well.
It also renames the struct to be a bit less specific to the
foreach method; the next patch will reuse this in a different
API.
@staktrace
Copy link
Contributor Author

Patches rebased to master.

@alexcrichton
Copy link
Member

Seems reasonable to me! Usage-wise a builder might be a bit more ergonomic than a many-argument-method, but I don't really have much of a preference one way or another.

This could be improved by adding color support, etc.
@staktrace
Copy link
Contributor Author

Patches ready for review now. I ran rustfmt and modified the diff example a bit more to allow colorized output for the --blobs option that I added.

@alexcrichton alexcrichton merged commit 47d4e6a into rust-lang:master Apr 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants