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

explore replacing plugins/git nom parser with libgit2 function calls #575

Closed
j-lanson opened this issue Nov 5, 2024 · 0 comments · Fixed by #663
Closed

explore replacing plugins/git nom parser with libgit2 function calls #575

j-lanson opened this issue Nov 5, 2024 · 0 comments · Fixed by #663
Assignees
Labels
product: hc Relates to the core "hc" binary type: enhancement New feature or request

Comments

@j-lanson
Copy link
Collaborator

j-lanson commented Nov 5, 2024

To get commit diffs for a repo, our git plugin currently uses a configured git log message to get the entire diff history the repo, and uses a nom parser to extract data into Diff objects. The log data we parse does not include commit hashes, so if there are any corner cases, the parser will fail and commits.len() != diffs.len(). Rather than relying on the parser, we should see if we can use the Rust libgit2 bindings to synthesize CommitDiff objects in a much more reliable way.

This link shows example code in C of how to use the libgit2 API to get git log -like info. The task will be to see if we can do something similar to get the diff info we need to construct CommitDiff objects, and preferably remove the need to zip two independently-derived Vecs together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: hc Relates to the core "hc" binary type: enhancement New feature or request
Projects
Status: Done
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants