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
remove git2go dependency #1001
remove git2go dependency #1001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Welcome to Kubescape. Thank you for taking the time and contributing to the open source community
We will try to review as soon as possible!
I still need to edit README |
cc: @amirmalka |
Don't merge it as is, we have perf regression. |
var allCommits []*git2go.Commit | ||
err := logItr.Iterate(func(commit *git2go.Commit) bool { | ||
var allCommits []*objectv5.Commit | ||
err = logItr.ForEach(func(commit *objectv5.Commit) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@matthyx so if I understand correctly, this is the critical part that used to be slow (and might still be) and justified the use of the native git bindings? Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check the other comment
prevTree, err = prevCommit.Tree() | ||
if err != nil { | ||
continue | ||
} | ||
} | ||
|
||
diff, err := g.git2GoRepo.DiffTreeToTree(prevTree, tree, nil) | ||
changes, err := prevTree.Diff(tree) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the slow part... merkle tree diffs are painfully slow
I have tried to walk around with some commit.Files()
to skip the tree diffs, but it's still slow to open blobs in order to get files changed.
I assume this fixes #832. |
Will not be merged as explained here. |
Describe your changes
Remove git2go dependency and replace functionalities with go-git.
Screenshots - If Any (Optional)
This PR fixes:
Checklist before requesting a review
Please open the PR against the
dev
branch (Unless the PR contains only documentation changes)