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

Is anywhere to make a git log like way? #666

Closed
phodal opened this issue Jan 26, 2021 · 2 comments
Closed

Is anywhere to make a git log like way? #666

phodal opened this issue Jan 26, 2021 · 2 comments

Comments

@phodal
Copy link

phodal commented Jan 26, 2021

I'm using git2-rs to build a Git-base tools. And now, I want to get all changes from a commits, such as those code in Git Objects:

$ git log --stat 1a410e
commit 1a410efbd13591db07496601ebc7a059dd55cfe9
Author: Scott Chacon <schacon@gmail.com>
Date:   Fri May 22 18:15:24 2009 -0700

	Third commit

 bak/test.txt | 1 +
 1 file changed, 1 insertion(+)

And I find the C++ version of git log in https://libgit2.org/libgit2/ex/HEAD/log.html

It seems we need to expose git_commit_parent(&parent, commit, (size_t)i) method to compare parent, then we can get the different?

But I had search code, it seems no way to do in git2-rs?

@alexcrichton
Copy link
Member

The Rust version of that example is translated here -- https://github.com/rust-lang/git2-rs/blob/master/examples/log.rs

@phodal
Copy link
Author

phodal commented Jan 26, 2021

thanks

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

No branches or pull requests

2 participants